feat: Remove unused event serialization
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -284,34 +284,4 @@ class SecurityEvent extends Event
|
|||||||
$this->severity = $severity;
|
$this->severity = $severity;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSeverityLabel(): string
|
|
||||||
{
|
|
||||||
return match ($this->severity) {
|
|
||||||
self::SEVERITY_DEBUG => 'DEBUG',
|
|
||||||
self::SEVERITY_INFO => 'INFO',
|
|
||||||
self::SEVERITY_WARNING => 'WARNING',
|
|
||||||
self::SEVERITY_ERROR => 'ERROR',
|
|
||||||
self::SEVERITY_CRITICAL => 'CRITICAL',
|
|
||||||
default => 'UNKNOWN',
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Override toArray to include security-specific fields
|
|
||||||
*/
|
|
||||||
public function toArray(): array
|
|
||||||
{
|
|
||||||
return array_merge(parent::toArray(), [
|
|
||||||
'ipAddress' => $this->ipAddress,
|
|
||||||
'deviceFingerprint' => $this->deviceFingerprint,
|
|
||||||
'userAgent' => $this->userAgent,
|
|
||||||
'requestPath' => $this->requestPath,
|
|
||||||
'requestMethod' => $this->requestMethod,
|
|
||||||
'userId' => $this->userId,
|
|
||||||
'reason' => $this->reason,
|
|
||||||
'severity' => $this->severity,
|
|
||||||
'severityLabel' => $this->getSeverityLabel(),
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -136,18 +136,4 @@ class Event
|
|||||||
$this->identityId = $identityId;
|
$this->identityId = $identityId;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert event to array for serialization/logging
|
|
||||||
*/
|
|
||||||
public function toArray(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
'name' => $this->name,
|
|
||||||
'data' => $this->data,
|
|
||||||
'timestamp' => $this->timestamp,
|
|
||||||
'tenantId' => $this->tenantId,
|
|
||||||
'identityId' => $this->identityId,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user