/** * {@inheritDoc} * @throws InvalidArgumentException If status code is not 4xx */ public function __construct($statusCode, $message = '', $errors = null) { // Client errors code are 4xx if ($statusCode < 400 || $statusCode > 499) { throw new InvalidArgumentException(sprintf('Status code for client errors must be between 400 and 499, "%s" given', $statusCode)); } parent::__construct($statusCode, $message, $errors); }
/** * {@inheritDoc} * @throws InvalidArgumentException If status code is not 5xx */ public function __construct($statusCode, $message = '', $errors = null) { // Server errors code are 5xx if ($statusCode < 500 || $statusCode > 599) { throw new InvalidArgumentException(sprintf('Status code for server errors must be between 500 and 599, "%s" given', $statusCode)); } parent::__construct($statusCode, $message, $errors); }