Skip to content

Commit 23b30a4

Browse files
authored
refactor: cleanup imports/nullables (#36)
1 parent adf187a commit 23b30a4

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/Helpers/AuditResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
class AuditResolver
99
{
10-
public static function findUserId(Model|null $model): ?int
10+
public static function findUserId(?Model $model): ?int
1111
{
1212
if (empty($model)) {
1313
return null;

src/Models/AuditActivity.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use App\User;
77
use Carbon\Carbon;
8+
use Exception;
89
use Illuminate\Database\Eloquent\Relations\BelongsTo;
910
use Illuminate\Database\Eloquent\Relations\MorphTo;
1011
use Sourcetoad\Logger\Enums\ActivityType;
@@ -54,7 +55,7 @@ class AuditActivity extends BaseModel
5455
// Mutators
5556
//--------------------------------------------------------------------------------------------------------------
5657

57-
protected function setIpAddressAttribute(string|null $value): void
58+
protected function setIpAddressAttribute(?string $value): void
5859
{
5960
$this->attributes['ip_address'] = inet_pton((string)$value);
6061
}
@@ -90,7 +91,7 @@ public function getHumanActivityAttribute(): string
9091
ActivityType::PASSWORD_CHANGE => trans('logger::enums.activity_type_password_change'),
9192
ActivityType::GET_DATA => trans('logger::enums.activity_type_get_data'),
9293
ActivityType::MODIFY_DATA => trans('logger::enums.activity_type_modify_data'),
93-
default => throw new \Exception('Unknown enum type: ' . $this->type),
94+
default => throw new Exception('Unknown enum type: ' . $this->type),
9495
};
9596
}
9697

0 commit comments

Comments
 (0)