| Total Complexity | 8 |
| Total Lines | 70 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 5 | trait ErrorTrait |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * The last error code |
||
| 9 | * |
||
| 10 | * @var int |
||
| 11 | */ |
||
| 12 | protected $errno = 0; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The last error message |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $error = ''; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @inheritDoc |
||
| 23 | */ |
||
| 24 | public function setError(string $error = '') |
||
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @inheritDoc |
||
| 31 | */ |
||
| 32 | public function error() |
||
| 33 | { |
||
| 34 | return $this->error; |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @inheritDoc |
||
| 39 | */ |
||
| 40 | public function hasError() |
||
| 41 | { |
||
| 42 | return $this->error !== ''; |
||
| 43 | } |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @inheritDoc |
||
| 47 | */ |
||
| 48 | public function setErrno(int $errno) |
||
| 49 | { |
||
| 50 | $this->errno = $errno; |
||
| 51 | } |
||
| 52 | |||
| 53 | /** |
||
| 54 | * @inheritDoc |
||
| 55 | */ |
||
| 56 | public function errno() |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @inheritDoc |
||
| 63 | */ |
||
| 64 | public function hasErrno() |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @inheritDoc |
||
| 71 | */ |
||
| 72 | public function errorMessage() |
||
| 75 | } |
||
| 76 | } |
||
| 77 |