don't allocate a variable in the handler check
This commit is contained in:
parent
012d306d3a
commit
e2e8cd66f5
@ -128,14 +128,11 @@ class Router
|
||||
*/
|
||||
private function checkForHandlers(array $node): bool
|
||||
{
|
||||
$hasHandlers = false;
|
||||
foreach (['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'] as $m) {
|
||||
if (isset($node[$m])) {
|
||||
$hasHandlers = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $hasHandlers;
|
||||
foreach (['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'] as $m)
|
||||
if (isset($node[$m]))
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user