folded-php / exception

Various kind of exception to throw for your web app.

Home Page:https://packagist.org/packages/folded/exception

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add the possibility to mention the URL to the MethodNotAllowedException

khalyomede opened this issue · comments

Description

When throwing a MethodNotAllowedException, it would be useful to be able to specify the URL that is not allowed for debug purposes.

Expected behavior

To be able to mention the URL like following:

use Folded\Exceptions\MethodNotAllowedException;

$exception = new MethodNotAllowedException();
$exception->setUrl("/")->setMethodNotAllowed("POST")->setAllowedMethods(["GET"]);

echo $exception->getUrl(); // string(1) "/"

Alternatives solutions

None.

Hey, I would like to work on this one !