git-svn-id: https://msi/svn/firstRepo/Service/branches/Slim3@40 0f545695-f87b-41b6-9a03-7f16563b5454
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Slim\Exception;
|
||||
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
||||
class MethodNotAllowedException extends SlimException
|
||||
{
|
||||
/**
|
||||
* HTTP methods allowed
|
||||
*
|
||||
* @var string[]
|
||||
*/
|
||||
protected $allowedMethods;
|
||||
|
||||
/**
|
||||
* Create new exception
|
||||
*
|
||||
* @param ServerRequestInterface $request
|
||||
* @param ResponseInterface $response
|
||||
* @param string[] $allowedMethods
|
||||
*/
|
||||
public function __construct(ServerRequestInterface $request, ResponseInterface $response, array $allowedMethods)
|
||||
{
|
||||
parent::__construct($request, $response);
|
||||
$this->allowedMethods = $allowedMethods;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get allowed methods
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
public function getAllowedMethods()
|
||||
{
|
||||
return $this->allowedMethods;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user