1 | <?php |
||
5 | trait IsMeasurable |
||
6 | { |
||
7 | /** |
||
8 | * Has the task got an expected target. |
||
9 | * |
||
10 | * @return bool |
||
11 | */ |
||
12 | public function hasDateTarget() : bool |
||
16 | |||
17 | /** |
||
18 | * Is the task still in process. |
||
19 | * |
||
20 | * @return bool |
||
21 | */ |
||
22 | public function isInProcess() : bool |
||
26 | |||
27 | /** |
||
28 | * Is the task not due yet. |
||
29 | * |
||
30 | * @return bool |
||
31 | */ |
||
32 | public function notDueYet() : bool |
||
36 | |||
37 | /** |
||
38 | * Is the task complete. |
||
39 | * |
||
40 | * @return bool |
||
41 | */ |
||
42 | public function completed() : bool |
||
52 | |||
53 | /** |
||
54 | * Was the task completed after the given deadline. |
||
55 | * |
||
56 | * @return bool |
||
57 | */ |
||
58 | public function completedAfterSchedule() : bool |
||
62 | |||
63 | /** |
||
64 | * Was the task completed before the given deadline. |
||
65 | * |
||
66 | * @return bool |
||
67 | */ |
||
68 | public function completedBeforeSchedule() : bool |
||
72 | |||
73 | /** |
||
74 | * Was the task completed before or on the given deadline. |
||
75 | * |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function completedOnSchedule() : bool |
||
82 | |||
83 | /** |
||
84 | * Is the task overdue. |
||
85 | * |
||
86 | * @return bool |
||
87 | */ |
||
88 | public function isOverdue() : bool |
||
92 | |||
93 | /** |
||
94 | * Have all tasks been completed. |
||
95 | * |
||
96 | * @return bool |
||
97 | */ |
||
98 | public function completedAllTasks() : bool |
||
108 | } |
||
109 |
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: