Skip to content

Commit

Permalink
Merge branch '5.2' into 5.x
Browse files Browse the repository at this point in the history
* 5.2:
  add missing return type declaration
  Modernize func_get_args() calls to variadic parameters
  Use a lazyintertor to close files descriptors when no longer used
  • Loading branch information
xabbuh committed Feb 12, 2021
2 parents 4b48008 + 710d364 commit b84b3a9
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 @@ -736,14 +736,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 b84b3a9

Please sign in to comment.