Skip to content

Commit

Permalink
Run pint
Browse files Browse the repository at this point in the history
  • Loading branch information
ttrig committed Mar 18, 2024
1 parent 9544ea5 commit a11abe2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function initiatorContext(string $key, $value = null): self
return $this;
}

public function log(string $event = null, array $eventContext = []): void
public function log(?string $event = null, array $eventContext = []): void
{
if ($event) {
$this->event($event, $eventContext);
Expand Down
12 changes: 6 additions & 6 deletions src/Auditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ public function log(Audit $audit): void
}
}

public function assertLogged(string $eventName, Closure $callback = null): void
public function assertLogged(string $eventName, ?Closure $callback = null): void
{
PHPUnit::assertTrue(
$this->recorded($eventName, $callback)->isNotEmpty(),
"The expected audit event [{$eventName}] was not logged."
);
}

public function assertNotLogged(string $eventName, Closure $callback = null): void
public function assertNotLogged(string $eventName, ?Closure $callback = null): void
{
PHPUnit::assertCount(
0,
Expand All @@ -78,7 +78,7 @@ public function assertLoggedCount(int $count): void
PHPUnit::assertCount($count, $this->recorded);
}

public function recorded(string $eventName, Closure $callback = null): Collection
public function recorded(string $eventName, ?Closure $callback = null): Collection
{
$callback = $callback ?: fn () => true;

Expand All @@ -87,7 +87,7 @@ public function recorded(string $eventName, Closure $callback = null): Collectio
&& $callback($data));
}

public function correlationId(string $correlationId = null): string
public function correlationId(?string $correlationId = null): string
{
if (func_num_args() === 1) {
$this->correlationId = $correlationId;
Expand All @@ -96,7 +96,7 @@ public function correlationId(string $correlationId = null): string
return $this->correlationId ??= request()->header('X-Correlation-ID', (string) str()->uuid());
}

public function correlationTrail(string $correlationTrail = null): ?string
public function correlationTrail(?string $correlationTrail = null): ?string
{
if (func_num_args() === 1) {
$this->correlationTrail = $correlationTrail;
Expand Down Expand Up @@ -127,7 +127,7 @@ public function httpHeaders(): array
]);
}

public function initiatorResolver(Closure $resolver = null): ?Closure
public function initiatorResolver(?Closure $resolver = null): ?Closure
{
if (func_num_args() === 1) {
static::$initiatorResolver = $resolver;
Expand Down

0 comments on commit a11abe2

Please sign in to comment.