Skip to content

Commit

Permalink
Modernize func_get_args() calls to variadic parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Feb 11, 2021
1 parent 83a6fee commit 715e7a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Filesystem.php
Original file line number Diff line number Diff line change
Expand Up @@ -746,14 +746,16 @@ private function getSchemeAndHierarchy(string $filename): array
}

/**
* @param mixed ...$args
*
* @return mixed
*/
private static function box(callable $func)
private static function box(callable $func, ...$args)
{
self::$lastError = null;
set_error_handler(__CLASS__.'::handleError');
try {
$result = $func(...\array_slice(\func_get_args(), 1));
$result = $func(...$args);
restore_error_handler();

return $result;
Expand Down

0 comments on commit 715e7a5

Please sign in to comment.