Skip to content

Commit

Permalink
Update to use latest PHP 8.1 syntax
Browse files Browse the repository at this point in the history
Signed-off-by: Abdul Malik Ikhsan <[email protected]>
  • Loading branch information
samsonasik committed Nov 7, 2024
1 parent 9a255ee commit 4b9a815
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Runner/Runner.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ public function setConfig($config)
}

foreach ($config as $key => $val) {
$methodName = 'set' . implode(array_map(static fn($value): string => ucfirst($value), explode('_', $key)));
$methodName = 'set' . implode(
'',
array_map(static fn($value): string => ucfirst($value), explode('_', $key))
);

if (! is_callable([$this, $methodName])) {
throw new BadMethodCallException('Unknown config parameter ' . $key);
Expand Down Expand Up @@ -411,7 +414,7 @@ protected function triggerReporters($eventType)

protected function startErrorHandler()
{
set_error_handler([$this, 'errorHandler'], $this->catchErrorSeverity);
set_error_handler($this->errorHandler(...), $this->catchErrorSeverity);

Check failure on line 417 in src/Runner/Runner.php

View workflow job for this annotation

GitHub Actions / QA Checks (Psalm [8.1, locked], ubuntu-latest, laminas/laminas-continuous-integration-action@v1, ...

InvalidArgument

src/Runner/Runner.php:417:27: InvalidArgument: Argument 1 of set_error_handler expects callable(int, string, string=, int=, array<array-key, mixed>=):bool|null, but impure-Closure(int, string=, string=, int=):void provided (see https://psalm.dev/004)
}

/**
Expand Down

0 comments on commit 4b9a815

Please sign in to comment.