forked from PHP/Router
Update SegmentRouterTrait.php
This commit is contained in:
parent
a395b7ae17
commit
a73142eabb
|
@ -80,13 +80,12 @@ trait SegmentRouterTrait
|
|||
}
|
||||
}
|
||||
|
||||
// if the method doesn't exist, return 405
|
||||
if (! array_key_exists($method, $node)) {
|
||||
return ['code' => 405, 'handler' => null, 'params' => []];
|
||||
// if we found a handler for the method, return it and any params. if not, return a 405
|
||||
if (array_key_exists($method, $node)) {
|
||||
return ['code' => 200, 'handler' => $node[$method], 'params' => $params];
|
||||
}
|
||||
|
||||
// if we found a handler for the method, return it and any params. if not, return a 405
|
||||
return ['code' => 200, 'handler' => $node[$method], 'params' => $params];
|
||||
return ['code' => 405, 'handler' => null, 'params' => []];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue
Block a user