| 1 | <?php |
||
| 13 | class Connection_Error extends \WP_Error { |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Stores the list of data for error codes. |
||
| 17 | * |
||
| 18 | * @var array |
||
| 19 | */ |
||
| 20 | public $error_info = array(); |
||
| 21 | |||
| 22 | public function __construct( $error_code, $data, $report = true ) { |
||
| 41 | |||
| 42 | public function get_info( $info_key = '', $code = '' ) { |
||
| 56 | |||
| 57 | public function get_title( $code = '' ) { |
||
| 60 | |||
| 61 | public function get_fix_tip( $code = '' ) { |
||
| 64 | |||
| 65 | } |
||
| 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: