Skip to content

Conversation

@jtojnar
Copy link

@jtojnar jtojnar commented Jan 17, 2022

This will allow us to have code like this:

$router->set404(function($handledByOtherMethod) {
    if ($handledByOtherMethod) {
        header('HTTP/1.1 405 Method Not Allowed');
    } else {
        header('HTTP/1.1 404 Not Found');
    }
    // ... do something special here
});

This would make `RouterTest::testArrayMatch` fail with:

	Undefined array key "PUT"

	src/Bramus/Router/Router.php:298
	tests/RouterTest.php:242
	vendor/bin/phpunit:110
@jtojnar jtojnar force-pushed the 405 branch 2 times, most recently from 5e478cc to 6d9ae78 Compare January 18, 2022 02:58
@oskarniziol
Copy link

Good idea!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants