Skip to content

Commit 319dbea

Browse files
committed
chore: fix linting
1 parent 85d82e3 commit 319dbea

File tree

1 file changed

+25
-26
lines changed

1 file changed

+25
-26
lines changed

app/Audit/ConcreteFormatters/UserActionAuditLogFormatter.php

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,30 @@
2525
*/
2626
class UserActionAuditLogFormatter implements IChildEntityAuditLogFormatter
2727
{
28-
/**
29-
* @param UserAction $subject
30-
* @param string $child_entity_action_type
31-
* @param string|null $additional_info
32-
* @return string|null
33-
*/
34-
public function format($subject, string $child_entity_action_type, ?string $additional_info = ""): ?string
35-
{
36-
37-
if (!$subject instanceof UserAction) {
38-
return null;
39-
}
40-
41-
$owner = $subject->getOwner();
42-
$realm = $subject->hasRealm() ? $subject->getRealm() : 'N/A';
43-
$ip = $subject->getFromIp();
44-
45-
switch ($child_entity_action_type) {
46-
case IChildEntityAuditLogFormatter::CHILD_ENTITY_CREATION:
47-
return "A new UserAction which owner is \"{$owner->getFullName()} ({$owner->getID()})\", with realm \"{$realm}\" and IP \"{$ip}\" was created. {$additional_info}";
48-
case IChildEntityAuditLogFormatter::CHILD_ENTITY_UPDATE:
49-
return "An UserAction with ID {$subject->getID()} was changed. {$additional_info}";
50-
case IChildEntityAuditLogFormatter::CHILD_ENTITY_DELETION:
51-
return "An UserAction with ID {$subject->getID()} which owner is \"{$owner->getFullName()} ({$owner->getID()})\", with realm \"{$realm}\" and IP \"{$ip}\" was removed";
28+
/**
29+
* @param UserAction $subject
30+
* @param string $child_entity_action_type
31+
* @param string|null $additional_info
32+
* @return string|null
33+
*/
34+
public function format($subject, string $child_entity_action_type, ?string $additional_info = ""): ?string
35+
{
36+
if (!$subject instanceof UserAction) {
37+
return null;
38+
}
39+
40+
$owner = $subject->getOwner();
41+
$realm = $subject->hasRealm() ? $subject->getRealm() : 'N/A';
42+
$ip = $subject->getFromIp();
43+
44+
switch ($child_entity_action_type) {
45+
case IChildEntityAuditLogFormatter::CHILD_ENTITY_CREATION:
46+
return "A new UserAction which owner is \"{$owner->getFullName()} ({$owner->getID()})\", with realm \"{$realm}\" and IP \"{$ip}\" was created. {$additional_info}";
47+
case IChildEntityAuditLogFormatter::CHILD_ENTITY_UPDATE:
48+
return "An UserAction with ID {$subject->getID()} was changed. {$additional_info}";
49+
case IChildEntityAuditLogFormatter::CHILD_ENTITY_DELETION:
50+
return "An UserAction with ID {$subject->getID()} which owner is \"{$owner->getFullName()} ({$owner->getID()})\", with realm \"{$realm}\" and IP \"{$ip}\" was removed";
51+
}
52+
return "";
5253
}
53-
return "";
54-
}
5554
}

0 commit comments

Comments
 (0)