-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This new api is more in line with traditional routing apis in PHP. The previous api was extremely verbose and unnecesary. BREAKING CHANGE: This removes a lot of methods and complexity. - The ProtocolError exception was removed and replaced by case-by-case exceptions - The error handler does not log errors anymore nor attempt to id requests - Route now requires a handler - FinalHandler now throws proper exceptions
- Loading branch information
1 parent
7eac20e
commit d81256a
Showing
16 changed files
with
187 additions
and
292 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
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
This file was deleted.
Oops, something went wrong.
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,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
/** | ||
* @project Castor Router | ||
* @link https://github.com/castor-labs/router | ||
* @package castor/router | ||
* @author Matias Navarro-Carter [email protected] | ||
* @license MIT | ||
* @copyright 2021 CastorLabs Ltd | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
*/ | ||
|
||
namespace Castor\Http; | ||
|
||
use Throwable; | ||
|
||
class MethodNotAllowed extends RoutingError | ||
{ | ||
private array $allowedMethods; | ||
|
||
public function __construct($message = '', array $allowedMethods = [], $code = 0, Throwable $previous = null) | ||
{ | ||
parent::__construct($message, $code, $previous); | ||
$this->allowedMethods = $allowedMethods; | ||
} | ||
|
||
public function getAllowedMethods(): array | ||
{ | ||
return $this->allowedMethods; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.