1 | <?php |
||
5 | abstract class BaseOccurrence |
||
6 | { |
||
7 | /** |
||
8 | * Retourne la taille de l'occurence |
||
9 | * |
||
10 | * @return integer |
||
11 | */ |
||
12 | 14 | public function size() |
|
13 | { |
||
14 | 14 | return $this->size; |
|
|
|||
15 | } |
||
16 | |||
17 | /** |
||
18 | * Valide la range de l'occurence |
||
19 | * |
||
20 | * @param integer $value |
||
21 | * @return integer |
||
22 | */ |
||
23 | abstract public function validate($value); |
||
24 | } |
||
25 |
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: