feat: make event state constructor-only and immutable
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -52,13 +52,17 @@ final class FirewallSettingsService
|
||||
$tenant->setConfiguration($configuration);
|
||||
$this->tenants->deposit($tenant);
|
||||
|
||||
$event = new SecurityEvent(SecurityEvent::FIREWALL_SETTINGS_UPDATED, [
|
||||
'changeReason' => $reason,
|
||||
'changeOrigin' => FirewallRuleManager::ORIGIN_MANUAL,
|
||||
'previous' => $previous,
|
||||
'current' => $current,
|
||||
]);
|
||||
$event->setTenantId($tenantId)->setIdentityId($actorId);
|
||||
$event = new SecurityEvent(
|
||||
SecurityEvent::FIREWALL_SETTINGS_UPDATED,
|
||||
[
|
||||
'changeReason' => $reason,
|
||||
'changeOrigin' => FirewallRuleManager::ORIGIN_MANUAL,
|
||||
'previous' => $previous,
|
||||
'current' => $current,
|
||||
],
|
||||
tenantId: $tenantId,
|
||||
identityId: $actorId,
|
||||
);
|
||||
$this->events->dispatch($event);
|
||||
|
||||
return $current;
|
||||
|
||||
Reference in New Issue
Block a user