Compare commits

..

2 Commits

Author SHA1 Message Date
41e151f031 bump composer minor 2025-09-10 09:06:30 -05:00
e2e8cd66f5 don't allocate a variable in the handler check 2025-09-10 09:06:19 -05:00
2 changed files with 6 additions and 9 deletions

View File

@ -1,7 +1,7 @@
{ {
"name": "sharkk/router", "name": "sharkk/router",
"description": "A simple node-based router.", "description": "A simple node-based router.",
"version": "1.2.7", "version": "1.2.8",
"type": "library", "type": "library",
"license": "MIT", "license": "MIT",
"autoload": { "autoload": {

View File

@ -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;
} }
/** /**