Parsing.php
32 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WonderPush\Errors; |
| 4 | |
| 5 | if (count(get_included_files()) === 1) { http_response_code(403); exit(); } // Prevent direct access |
| 6 | |
| 7 | /** |
| 8 | * JSON related errors. |
| 9 | */ |
| 10 | class Parsing extends Base { |
| 11 | |
| 12 | /** |
| 13 | * The output of json_last_error(); |
| 14 | * @var int |
| 15 | */ |
| 16 | private $jsonErrorCode; |
| 17 | |
| 18 | public function __construct($jsonErrorCode, $message = '', $codeStr = '0', \Exception $previous = null) { |
| 19 | parent::__construct($message, $codeStr, $previous); |
| 20 | $this->jsonErrorCode = $jsonErrorCode; |
| 21 | } |
| 22 | |
| 23 | /** |
| 24 | * The output of json_last_error(); |
| 25 | * @return int |
| 26 | */ |
| 27 | public function getJsonErrorCode() { |
| 28 | return $this->jsonErrorCode; |
| 29 | } |
| 30 | |
| 31 | } |
| 32 |