mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-03 12:45:20 +00:00
Various PSR12 code cleanup
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Rule.php
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
@@ -36,25 +37,25 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
/**
|
||||
* FireflyIII\Models\Rule
|
||||
*
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property Carbon|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property int $rule_group_id
|
||||
* @property string $title
|
||||
* @property string|null $description
|
||||
* @property int $order
|
||||
* @property bool $active
|
||||
* @property bool $stop_processing
|
||||
* @property bool $strict
|
||||
* @property-read string $action_value
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property Carbon|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property int $rule_group_id
|
||||
* @property string $title
|
||||
* @property string|null $description
|
||||
* @property int $order
|
||||
* @property bool $active
|
||||
* @property bool $stop_processing
|
||||
* @property bool $strict
|
||||
* @property-read string $action_value
|
||||
* @property-read Collection|RuleAction[] $ruleActions
|
||||
* @property-read int|null $rule_actions_count
|
||||
* @property-read RuleGroup $ruleGroup
|
||||
* @property Collection|RuleTrigger[] $ruleTriggers
|
||||
* @property-read int|null $rule_triggers_count
|
||||
* @property-read User $user
|
||||
* @property-read int|null $rule_actions_count
|
||||
* @property-read RuleGroup $ruleGroup
|
||||
* @property Collection|RuleTrigger[] $ruleTriggers
|
||||
* @property-read int|null $rule_triggers_count
|
||||
* @property-read User $user
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Rule newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Rule newQuery()
|
||||
* @method static Builder|Rule onlyTrashed()
|
||||
@@ -74,7 +75,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @method static Builder|Rule withTrashed()
|
||||
* @method static Builder|Rule withoutTrashed()
|
||||
* @mixin Eloquent
|
||||
* @property int|null $user_group_id
|
||||
* @property int|null $user_group_id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|Rule whereUserGroupId($value)
|
||||
*/
|
||||
class Rule extends Model
|
||||
@@ -103,7 +104,7 @@ class Rule extends Model
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
*
|
||||
* @param string $value
|
||||
* @param string $value
|
||||
*
|
||||
* @return Rule
|
||||
* @throws NotFoundHttpException
|
||||
@@ -111,7 +112,7 @@ class Rule extends Model
|
||||
public static function routeBinder(string $value): Rule
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$ruleId = (int) $value;
|
||||
$ruleId = (int)$value;
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Rule $rule */
|
||||
@@ -123,6 +124,15 @@ class Rule extends Model
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return HasMany
|
||||
@@ -151,7 +161,7 @@ class Rule extends Model
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @param mixed $value
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
@@ -159,13 +169,4 @@ class Rule extends Model
|
||||
{
|
||||
$this->attributes['description'] = e($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return BelongsTo
|
||||
*/
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user