diff --git a/src/Helpers/AuditResolver.php b/src/Helpers/AuditResolver.php index ab7440b..fe40996 100644 --- a/src/Helpers/AuditResolver.php +++ b/src/Helpers/AuditResolver.php @@ -7,7 +7,7 @@ class AuditResolver { - public static function findUserId(Model|null $model): ?int + public static function findUserId(?Model $model): ?int { if (empty($model)) { return null; diff --git a/src/Models/AuditActivity.php b/src/Models/AuditActivity.php index 91a176a..da484b0 100644 --- a/src/Models/AuditActivity.php +++ b/src/Models/AuditActivity.php @@ -5,6 +5,7 @@ use App\User; use Carbon\Carbon; +use Exception; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\MorphTo; use Sourcetoad\Logger\Enums\ActivityType; @@ -54,7 +55,7 @@ class AuditActivity extends BaseModel // Mutators //-------------------------------------------------------------------------------------------------------------- - protected function setIpAddressAttribute(string|null $value): void + protected function setIpAddressAttribute(?string $value): void { $this->attributes['ip_address'] = inet_pton((string)$value); } @@ -90,7 +91,7 @@ public function getHumanActivityAttribute(): string ActivityType::PASSWORD_CHANGE => trans('logger::enums.activity_type_password_change'), ActivityType::GET_DATA => trans('logger::enums.activity_type_get_data'), ActivityType::MODIFY_DATA => trans('logger::enums.activity_type_modify_data'), - default => throw new \Exception('Unknown enum type: ' . $this->type), + default => throw new Exception('Unknown enum type: ' . $this->type), }; }