mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-18 10:16:49 +00:00
Various PSR12 code cleanup
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* RuleGroup.php
|
||||
* Copyright (c) 2019 james@firefly-iii.org
|
||||
@@ -36,19 +37,19 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
/**
|
||||
* FireflyIII\Models\RuleGroup
|
||||
*
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property Carbon|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property string $title
|
||||
* @property string|null $description
|
||||
* @property int $order
|
||||
* @property bool $active
|
||||
* @property bool $stop_processing
|
||||
* @property int $id
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property Carbon|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property string $title
|
||||
* @property string|null $description
|
||||
* @property int $order
|
||||
* @property bool $active
|
||||
* @property bool $stop_processing
|
||||
* @property Collection|Rule[] $rules
|
||||
* @property-read int|null $rules_count
|
||||
* @property-read User $user
|
||||
* @property-read int|null $rules_count
|
||||
* @property-read User $user
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|RuleGroup newModelQuery()
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|RuleGroup newQuery()
|
||||
* @method static Builder|RuleGroup onlyTrashed()
|
||||
@@ -66,7 +67,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
* @method static Builder|RuleGroup withTrashed()
|
||||
* @method static Builder|RuleGroup withoutTrashed()
|
||||
* @mixin Eloquent
|
||||
* @property int|null $user_group_id
|
||||
* @property int|null $user_group_id
|
||||
* @method static \Illuminate\Database\Eloquent\Builder|RuleGroup whereUserGroupId($value)
|
||||
*/
|
||||
class RuleGroup extends Model
|
||||
@@ -94,7 +95,7 @@ class RuleGroup extends Model
|
||||
/**
|
||||
* Route binder. Converts the key in the URL to the specified object (or throw 404).
|
||||
*
|
||||
* @param string $value
|
||||
* @param string $value
|
||||
*
|
||||
* @return RuleGroup
|
||||
* @throws NotFoundHttpException
|
||||
@@ -102,7 +103,7 @@ class RuleGroup extends Model
|
||||
public static function routeBinder(string $value): RuleGroup
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$ruleGroupId = (int) $value;
|
||||
$ruleGroupId = (int)$value;
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var RuleGroup $ruleGroup */
|
||||
@@ -114,15 +115,6 @@ class RuleGroup extends Model
|
||||
throw new NotFoundHttpException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return HasMany
|
||||
*/
|
||||
public function rules(): HasMany
|
||||
{
|
||||
return $this->hasMany(Rule::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return BelongsTo
|
||||
@@ -131,4 +123,13 @@ class RuleGroup extends Model
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @return HasMany
|
||||
*/
|
||||
public function rules(): HasMany
|
||||
{
|
||||
return $this->hasMany(Rule::class);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user