Skip to content

Commit ca920e2

Browse files
committed
fix: missing constructor arg
1 parent 42535dd commit ca920e2

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app/Audit/AuditLogFormatterFactory.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ public function __construct()
3131
$this->config = config('audit_log', []);
3232
}
3333

34-
public function make(AuditContext $ctx, $subject, $eventType): ?IAuditLogFormatter
34+
public function make(AuditContext $ctx, $subject, string $event_type): ?IAuditLogFormatter
3535
{
3636
$formatter = null;
37-
switch ($eventType) {
37+
switch ($event_type) {
3838
case IAuditStrategy::EVENT_COLLECTION_UPDATE:
3939
$child_entity_formatter = null;
4040

@@ -101,20 +101,20 @@ public function make(AuditContext $ctx, $subject, $eventType): ?IAuditLogFormatt
101101
$formatter = new EntityCollectionUpdateAuditLogFormatter($child_entity_formatter);
102102
break;
103103
case IAuditStrategy::EVENT_ENTITY_CREATION:
104-
$formatter = $this->getFormatterByContext($subject, $eventType, $ctx);
104+
$formatter = $this->getFormatterByContext($subject, $event_type, $ctx);
105105
if(is_null($formatter)) {
106-
$formatter = new EntityCreationAuditLogFormatter();
106+
$formatter = new EntityCreationAuditLogFormatter($event_type);
107107
}
108108
break;
109109
case IAuditStrategy::EVENT_ENTITY_DELETION:
110-
$formatter = $this->getFormatterByContext($subject, $eventType, $ctx);
110+
$formatter = $this->getFormatterByContext($subject, $event_type, $ctx);
111111
if(is_null($formatter)) {
112112
$child_entity_formatter = ChildEntityFormatterFactory::build($subject);
113113
$formatter = new EntityDeletionAuditLogFormatter($child_entity_formatter);
114114
}
115115
break;
116116
case IAuditStrategy::EVENT_ENTITY_UPDATE:
117-
$formatter = $this->getFormatterByContext($subject, $eventType, $ctx);
117+
$formatter = $this->getFormatterByContext($subject, $event_type, $ctx);
118118
if(is_null($formatter)) {
119119
$child_entity_formatter = ChildEntityFormatterFactory::build($subject);
120120
$formatter = new EntityUpdateAuditLogFormatter($child_entity_formatter);

app/Audit/IAuditLogFormatterFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
interface IAuditLogFormatterFactory
44
{
5-
public function make(AuditContext $ctx, $subject, $eventType): ?IAuditLogFormatter;
5+
public function make(AuditContext $ctx, $subject, string $event_type): ?IAuditLogFormatter;
66
}

0 commit comments

Comments
 (0)