Skip to content

Commit

Permalink
Remove PHP 8.2 Checks (#48416)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jubeki authored Sep 15, 2023
1 parent 7ebfc9a commit 78cbe88
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -676,20 +676,12 @@ public function call($callback, array $parameters = [], $defaultMethod = null)
*/
protected function getClassForCallable($callback)
{
if (PHP_VERSION_ID >= 80200) {
if (is_callable($callback) &&
! ($reflector = new ReflectionFunction($callback(...)))->isAnonymous()) {
return $reflector->getClosureScopeClass()->name ?? false;
}

return false;
}

if (! is_array($callback)) {
return false;
if (is_callable($callback) &&
! ($reflector = new ReflectionFunction($callback(...)))->isAnonymous()) {
return $reflector->getClosureScopeClass()->name ?? false;
}

return is_string($callback[0]) ? $callback[0] : get_class($callback[0]);
return false;
}

/**
Expand Down

0 comments on commit 78cbe88

Please sign in to comment.