mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Clean up code.
This commit is contained in:
@@ -26,13 +26,14 @@ namespace FireflyIII\Support\Models;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
|
||||
/**
|
||||
* Trait ReturnsIntegerIdTrait
|
||||
* Trait ReturnsIntegerIdTrait
|
||||
*/
|
||||
trait ReturnsIntegerIdTrait
|
||||
{
|
||||
/**
|
||||
* Get the ID
|
||||
* @SuppressWarnings(PHPMD.ShortMethodName)
|
||||
*
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function id(): Attribute
|
||||
|
@@ -26,20 +26,10 @@ namespace FireflyIII\Support\Models;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
|
||||
/**
|
||||
* Trait ReturnsIntegerUserIdTrait
|
||||
* Trait ReturnsIntegerUserIdTrait
|
||||
*/
|
||||
trait ReturnsIntegerUserIdTrait
|
||||
{
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function userId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the user group ID
|
||||
*
|
||||
@@ -51,4 +41,14 @@ trait ReturnsIntegerUserIdTrait
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Attribute
|
||||
*/
|
||||
protected function userId(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: static fn($value) => (int)$value,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user