Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.8] Replace call_user_func* syntax in tests #3174

Merged
merged 1 commit into from
Sep 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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