| Conditions | 1 |
| Paths | 1 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function __construct( $error_code, $data ) { |
||
| 23 | |||
| 24 | $this->errors_handler = new Errors(); |
||
|
|
|||
| 25 | |||
| 26 | $error = $this->errors_handler->get_error( $error_code ); |
||
| 27 | |||
| 28 | parent::__construct( |
||
| 29 | $error_code, |
||
| 30 | $error['title'], |
||
| 31 | $data |
||
| 32 | ); |
||
| 33 | |||
| 34 | $this->error_info[ $error_code ] = $error; |
||
| 35 | |||
| 36 | $this->errors_handler->report_error( $this ); |
||
| 37 | |||
| 38 | } |
||
| 39 | |||
| 41 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: