-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Routing] refactored URL matching to support 405 Method Not Allowed r…
…esponses
- Loading branch information
1 parent
85778ca
commit b2f5ac8
Showing
14 changed files
with
374 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/Symfony/Component/Routing/Matcher/Exception/Exception.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Matcher\Exception; | ||
|
||
/** | ||
* A matching exception. | ||
* | ||
* @author Kris Wallsmith <kris@symfony.com> | ||
*/ | ||
interface Exception | ||
{ | ||
} |
36 changes: 36 additions & 0 deletions
36
src/Symfony/Component/Routing/Matcher/Exception/MethodNotAllowedException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Matcher\Exception; | ||
|
||
/** | ||
* The resource was found but the request method is not allowed. | ||
* | ||
* This exception should trigger an HTTP 405 response in your application code. | ||
* | ||
* @author Kris Wallsmith <kris@symfony.com> | ||
*/ | ||
class MethodNotAllowedException extends \RuntimeException implements Exception | ||
{ | ||
protected $allowedMethods; | ||
|
||
public function __construct(array $allowedMethods, $message = null, $code = 0, \Exception $previous = null) | ||
{ | ||
$this->allowedMethods = $allowedMethods; | ||
|
||
parent::__construct($message, $code, $previous); | ||
} | ||
|
||
public function getAllowedMethods() | ||
{ | ||
return $this->allowedMethods; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
src/Symfony/Component/Routing/Matcher/Exception/NotFoundException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
/* | ||
* This file is part of the Symfony package. | ||
* | ||
* (c) Fabien Potencier <fabien@symfony.com> | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Symfony\Component\Routing\Matcher\Exception; | ||
|
||
/** | ||
* The resource was not found. | ||
* | ||
* This exception should trigger an HTTP 404 response in your application code. | ||
* | ||
* @author Kris Wallsmith <kris@symfony.com> | ||
*/ | ||
class NotFoundException extends \RuntimeException implements Exception | ||
{ | ||
} |
Oops, something went wrong.