advanced-learning /
silverstripe-oauth2-server
| 1 | <?php |
||
| 2 | |||
| 3 | namespace AdvancedLearning\Oauth2Server\Exceptions; |
||
| 4 | |||
| 5 | |||
| 6 | use Exception; |
||
| 7 | use SilverStripe\Control\HTTPResponse; |
||
| 8 | use Throwable; |
||
| 9 | |||
| 10 | class AuthenticationException extends Exception |
||
| 11 | { |
||
| 12 | protected $response; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * AuthenticationException constructor. |
||
| 16 | * |
||
| 17 | * @param string $message Exception message. |
||
| 18 | * @param int $code Error code. |
||
| 19 | * @param HTTPResponse $response Response object for error. |
||
| 20 | * @param Throwable|null $previous Previous exception. |
||
| 21 | */ |
||
| 22 | public function __construct($message = "", $code = 0, HTTPResponse $response, Throwable $previous = null) |
||
|
0 ignored issues
–
show
|
|||
| 23 | { |
||
| 24 | $this->response = $response; |
||
| 25 | parent::__construct($message, $code, $previous); |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Get the error response object. |
||
| 30 | * |
||
| 31 | * @return HTTPResponse |
||
| 32 | */ |
||
| 33 | public function getResponse() |
||
| 34 | { |
||
| 35 | return $this->response; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |
If you place a parameter with a default value before a parameter with a default value, the default value of the first parameter will never be used as it will always need to be passed anyway: