1 | <?php |
||
8 | trait TracksQuota |
||
9 | { |
||
10 | /** |
||
11 | * @return bool |
||
12 | */ |
||
13 | public function isFull() |
||
17 | |||
18 | /** |
||
19 | * @return mixed |
||
20 | */ |
||
21 | public function percentFull() |
||
25 | |||
26 | /** |
||
27 | * @return bool |
||
28 | */ |
||
29 | public function shouldCheckSpace() |
||
41 | |||
42 | /** |
||
43 | * |
||
44 | */ |
||
45 | public function checkSpaceUsage() |
||
49 | |||
50 | /** |
||
51 | * @param Quota $quota |
||
52 | * |
||
53 | * @return $this |
||
54 | */ |
||
55 | public function updateQuota(Quota $quota) |
||
67 | } |
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: