12345678910111213141516171819202122232425262728293031 |
- <?php
- // Copyright 2019 Hackware SpA <human@hackware.cl>
- // "Hackware Web Services Core" is released under the MIT License terms.
- namespace Hawese\Core\Exceptions;
- use RuntimeException;
- class WrongCredentialsException extends RuntimeException
- {
- protected $statusCode;
- public function __construct($model, $identifier)
- {
- $identifier = htmlspecialchars($identifier);
- parent::__construct(
- "Wrong secret for $model $identifier", // message
- 4 // code
- );
- $this->statusCode = 403;
- }
- public function getStatusCode(): int
- {
- return $this->statusCode;
- }
- }
|