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
|
private function checkForHandlers(array $node): bool
|
||||||
{
|
{
|
||||||
$hasHandlers = false;
|
foreach (['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'] as $m)
|
||||||
foreach (['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'HEAD', 'OPTIONS'] as $m) {
|
if (isset($node[$m]))
|
||||||
if (isset($node[$m])) {
|
return true;
|
||||||
$hasHandlers = true;
|
|
||||||
break;
|
return false;
|
||||||
}
|
|
||||||
}
|
|
||||||
return $hasHandlers;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user