Skip to content

Commit

Permalink
Replace call_user_func* syntax in tests (#3174)
Browse files Browse the repository at this point in the history
  • Loading branch information
GrahamCampbell committed Sep 11, 2023
1 parent a427580 commit d95d9ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/TestLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function hasRecordThatPasses(callable $predicate, $level)
return false;
}
foreach ($this->recordsByLevel[$level] as $i => $rec) {
if (call_user_func($predicate, $rec, $i)) {
if ($predicate($rec, $i)) {
return true;
}
}
Expand All @@ -85,7 +85,7 @@ public function __call($method, $args)
if (method_exists($this, $genericMethod)) {
$args[] = $level;

return call_user_func_array([$this, $genericMethod], $args);
return ($this->{$genericMethod})(...$args);
}
}
throw new \BadMethodCallException('Call to undefined method '.static::class.'::'.$method.'()');
Expand Down

0 comments on commit d95d9ab

Please sign in to comment.