Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Helpers/AuditResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions src/Models/AuditActivity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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),
};
}

Expand Down