Conditions | 2 |
Paths | 2 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
13 | public function assert() |
||
14 | { |
||
15 | if (!preg_match( |
||
16 | $this->regex, |
||
1 ignored issue
–
show
|
|||
17 | $this->datum |
||
18 | ) |
||
19 | ) { |
||
20 | $this->errorMessageTemplate = self::DATA_FORMAT_ERROR; |
||
21 | $this->throwException(); |
||
22 | } |
||
23 | return true; |
||
24 | } |
||
25 | } |
||
26 |
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: