mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-18 10:39:28 +00:00
Clean up code.
This commit is contained in:
@@ -22,8 +22,10 @@
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace FireflyIII\Models;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Eloquent;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerIdTrait;
|
||||
use FireflyIII\Support\Models\ReturnsIntegerUserIdTrait;
|
||||
use FireflyIII\User;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
@@ -31,7 +33,6 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Carbon\Carbon;
|
||||
|
||||
/**
|
||||
* Class CurrencyExchangeRate
|
||||
@@ -40,9 +41,9 @@ use Carbon\Carbon;
|
||||
* @property Carbon|null $created_at
|
||||
* @property Carbon|null $updated_at
|
||||
* @property string|null $deleted_at
|
||||
* @property int $user_id
|
||||
* @property int $from_currency_id
|
||||
* @property int $to_currency_id
|
||||
* @property int $user_id
|
||||
* @property int $from_currency_id
|
||||
* @property int $to_currency_id
|
||||
* @property Carbon $date
|
||||
* @property string $rate
|
||||
* @property string $user_rate
|
||||
@@ -62,7 +63,7 @@ use Carbon\Carbon;
|
||||
* @method static Builder|CurrencyExchangeRate whereUpdatedAt($value)
|
||||
* @method static Builder|CurrencyExchangeRate whereUserId($value)
|
||||
* @method static Builder|CurrencyExchangeRate whereUserRate($value)
|
||||
* @property int $user_group_id
|
||||
* @property int $user_group_id
|
||||
* @method static Builder|CurrencyExchangeRate whereUserGroupId($value)
|
||||
* @method static Builder|CurrencyExchangeRate onlyTrashed()
|
||||
* @method static Builder|CurrencyExchangeRate withTrashed()
|
||||
@@ -111,26 +112,6 @@ class CurrencyExchangeRate extends Model
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function rate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function userRate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn ($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -141,6 +122,16 @@ class CurrencyExchangeRate extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function rate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
@@ -151,5 +142,15 @@ class CurrencyExchangeRate extends Model
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function userRate(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (string)$value,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user