Unhandled notice exception instead of 404 handling
- Dominant language
- PHP
- Stars
- 1.1k
- Forks
- 236
- PR merge metrics
- No merged PRs in 30d
Description
Notice: this issue is applicable for any HTTP method. Lets use PUT for example.
The Router throws '**Undefined index: PUT**' PHP notice when there is attempt to call PUT method, and no PUT routers were registered.
Snipet to reproduce:
```php
$router = new \Bramus\Router\Router();
$router->set404(function(){
echo 'Not found';
});
$router->run();
```
Expected: 404 handler triggered without PHP notices.
Actual: PHP notice
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at the Router entry points shown in the report, especially run() and the set404() handler, and reproduce the PUT request with no PUT route registered. Trace the method lookup that produces the undefined-index notice; done means the 404 handler runs without a PHP notice for unsupported HTTP methods.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100