/** * @param string $message * @param int $status * @param int $code * @param Throwable|null $previous */ public function __construct($message = "Not found", $status = 404, $code = 0, Throwable $previous = null) { parent::__construct($message, $status, $code, $previous); }
/** * @param string[] $methods * @param int $status * @param int $code * @param Throwable|null $previous */ public function __construct($methods, $status = 500, $code = 0, Throwable $previous = null) { $message = 'Method ' . '[' . implode($methods, ', ') . '] is not allowed'; parent::__construct($message, $status, $code, $previous); }
public function test_it_holds_on_to_a_status_code() { $e = new HttpException("Whoops!", 503); $this->assertEquals(503, $e->getStatusCode()); }