| Conditions | 5 |
| Paths | 8 |
| Total Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 42 | public function get_info( $info_key = '', $code = '' ) { |
||
| 43 | if ( empty( $code ) ) { |
||
| 44 | $code = $this->get_error_code(); |
||
| 45 | } |
||
| 46 | if ( isset( $this->error_info[ $code ] ) ) { |
||
| 47 | if ( empty( $info_key ) ) { |
||
| 48 | return $this->error_info[ $code ]; |
||
| 49 | } |
||
| 50 | |||
| 51 | if ( isset( $this->error_info[ $code ][ $info_key ] ) ) { |
||
| 52 | return $this->error_info[ $code ][ $info_key ]; |
||
| 53 | } |
||
| 54 | } |
||
| 55 | } |
||
| 56 | |||
| 66 |
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: