Various code cleanup.

This commit is contained in:
James Cole
2018-08-04 17:30:06 +02:00
parent 5af026674f
commit f0d3ca5d53
88 changed files with 552 additions and 311 deletions

View File

@@ -25,6 +25,8 @@ namespace FireflyIII\Models;
use Carbon\Carbon;
use FireflyIII\User;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Support\Collection;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@@ -60,16 +62,16 @@ class RuleGroup extends Model
'order' => 'int',
];
/**
* @var array
*/
/** @var array Fields that can be filled */
protected $fillable = ['user_id', 'order', 'title', 'description', 'active'];
/**
* Route binder. Converts the key in the URL to the specified object (or throw 404).
*
* @param string $value
*
* @return RuleGroup
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException
* @throws NotFoundHttpException
*/
public static function routeBinder(string $value): RuleGroup
{
@@ -88,18 +90,18 @@ class RuleGroup extends Model
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\HasMany
* @return HasMany
*/
public function rules(): \Illuminate\Database\Eloquent\Relations\HasMany
public function rules(): HasMany
{
return $this->hasMany(Rule::class);
}
/**
* @codeCoverageIgnore
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
* @return BelongsTo
*/
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
public function user(): BelongsTo
{
return $this->belongsTo(User::class);
}