mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-03 20:56:21 +00:00
Code cleanup.
This commit is contained in:
@@ -39,36 +39,36 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
/**
|
||||
* Class Account
|
||||
*
|
||||
* @property int $id
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property \Illuminate\Support\Carbon|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property int $account_type_id
|
||||
* @property string $name
|
||||
* @property string|null $virtual_balance
|
||||
* @property string|null $iban
|
||||
* @property bool $active
|
||||
* @property bool $encrypted
|
||||
* @property int $order
|
||||
* @property int $id
|
||||
* @property \Illuminate\Support\Carbon|null $created_at
|
||||
* @property \Illuminate\Support\Carbon|null $updated_at
|
||||
* @property \Illuminate\Support\Carbon|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property int $account_type_id
|
||||
* @property string $name
|
||||
* @property string|null $virtual_balance
|
||||
* @property string|null $iban
|
||||
* @property bool $active
|
||||
* @property bool $encrypted
|
||||
* @property int $order
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\AccountMeta[] $accountMeta
|
||||
* @property-read int|null $account_meta_count
|
||||
* @property-read \FireflyIII\Models\AccountType $accountType
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments
|
||||
* @property-read int|null $attachments_count
|
||||
* @property-read string $account_number
|
||||
* @property-read string $edit_name
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Location[] $locations
|
||||
* @property-read int|null $locations_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Note[] $notes
|
||||
* @property-read int|null $notes_count
|
||||
* @property-read int|null $account_meta_count
|
||||
* @property-read \FireflyIII\Models\AccountType $accountType
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Attachment[] $attachments
|
||||
* @property-read int|null $attachments_count
|
||||
* @property-read string $account_number
|
||||
* @property-read string $edit_name
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Location[] $locations
|
||||
* @property-read int|null $locations_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Note[] $notes
|
||||
* @property-read int|null $notes_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\ObjectGroup[] $objectGroups
|
||||
* @property-read int|null $object_groups_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks
|
||||
* @property-read int|null $piggy_banks_count
|
||||
* @property-read int|null $object_groups_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\PiggyBank[] $piggyBanks
|
||||
* @property-read int|null $piggy_banks_count
|
||||
* @property-read \Illuminate\Database\Eloquent\Collection|\FireflyIII\Models\Transaction[] $transactions
|
||||
* @property-read int|null $transactions_count
|
||||
* @property-read User $user
|
||||
* @property-read int|null $transactions_count
|
||||
* @property-read User $user
|
||||
* @method static EloquentBuilder|Account accountTypeIn($types)
|
||||
* @method static EloquentBuilder|Account newModelQuery()
|
||||
* @method static EloquentBuilder|Account newQuery()
|
||||
@@ -120,13 +120,13 @@ class Account extends Model
|
||||
*
|
||||
* @param string $value
|
||||
*
|
||||
* @throws NotFoundHttpException
|
||||
* @return Account
|
||||
* @throws NotFoundHttpException
|
||||
*/
|
||||
public static function routeBinder(string $value): Account
|
||||
{
|
||||
if (auth()->check()) {
|
||||
$accountId = (int) $value;
|
||||
$accountId = (int)$value;
|
||||
/** @var User $user */
|
||||
$user = auth()->user();
|
||||
/** @var Account $account */
|
||||
@@ -255,7 +255,7 @@ class Account extends Model
|
||||
public function setVirtualBalanceAttribute($value): void
|
||||
{
|
||||
$value = (string)$value;
|
||||
if('' === $value) {
|
||||
if ('' === $value) {
|
||||
$value = null;
|
||||
}
|
||||
$this->attributes['virtual_balance'] = $value;
|
||||
|
||||
Reference in New Issue
Block a user