Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
8 | public function getMessage() |
||
9 | { |
||
10 | switch ($this->code) { |
||
|
|||
11 | case self::ROW_VALIDATION_FAILED: |
||
12 | return "row {$this->extraDetails["row"]}.{$this->extraDetails["col"]}({$this->extraDetails["val"]}): {$this->extraDetails["error"]}"; |
||
13 | default: |
||
14 | return parent::getMessage(); |
||
15 | } |
||
16 | } |
||
17 | } |
||
18 |
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: