From ba4deccea9b9816e613a1fd3fe68315ed55d25d3 Mon Sep 17 00:00:00 2001 From: Sebastian Krupinski Date: Wed, 5 Aug 2026 22:21:04 -0400 Subject: [PATCH] feat: Remove unused event serialization Signed-off-by: Sebastian Krupinski --- core/lib/Security/Event/SecurityEvent.php | 30 ----------------------- shared/lib/Event/Event.php | 14 ----------- 2 files changed, 44 deletions(-) diff --git a/core/lib/Security/Event/SecurityEvent.php b/core/lib/Security/Event/SecurityEvent.php index ca9247f..ccfaee3 100644 --- a/core/lib/Security/Event/SecurityEvent.php +++ b/core/lib/Security/Event/SecurityEvent.php @@ -284,34 +284,4 @@ class SecurityEvent extends Event $this->severity = $severity; 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(), - ]); - } } diff --git a/shared/lib/Event/Event.php b/shared/lib/Event/Event.php index 16c65d2..1ea6c96 100644 --- a/shared/lib/Event/Event.php +++ b/shared/lib/Event/Event.php @@ -136,18 +136,4 @@ class Event $this->identityId = $identityId; 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, - ]; - } }