1 | <?php |
||
20 | class DateHelper extends Base |
||
21 | { |
||
22 | /** |
||
23 | * Get formatted time. |
||
24 | * |
||
25 | * @param int $value |
||
26 | * |
||
27 | * @return string |
||
28 | */ |
||
29 | public function time($value) |
||
33 | |||
34 | /** |
||
35 | * Get formatted date. |
||
36 | * |
||
37 | * @param int $value |
||
38 | * |
||
39 | * @return string |
||
40 | */ |
||
41 | public function date($value) |
||
53 | |||
54 | /** |
||
55 | * Get formatted datetime. |
||
56 | * |
||
57 | * @param int $value |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | public function datetime($value) |
||
65 | |||
66 | /** |
||
67 | * Get duration in seconds into human format. |
||
68 | * |
||
69 | * @param int $seconds |
||
70 | * |
||
71 | * @return string |
||
72 | */ |
||
73 | public function duration($seconds) |
||
84 | |||
85 | /** |
||
86 | * Get the age of an item in quasi human readable format. |
||
87 | * It's in this format: <1h , NNh, NNd. |
||
88 | * |
||
89 | * @param int $timestamp Unix timestamp of the artifact for which age will be calculated |
||
90 | * @param int $now Compare with this timestamp (Default value is the current unix timestamp) |
||
91 | * |
||
92 | * @return string |
||
93 | */ |
||
94 | public function age($timestamp, $now = null) |
||
115 | |||
116 | /** |
||
117 | * Get all hours for day. |
||
118 | * |
||
119 | * @return array |
||
120 | */ |
||
121 | public function getDayHours() |
||
134 | |||
135 | /** |
||
136 | * Get all days of a week. |
||
137 | * |
||
138 | * @return array |
||
139 | */ |
||
140 | public function getWeekDays() |
||
150 | |||
151 | /** |
||
152 | * Get the localized day name from the day number. |
||
153 | * |
||
154 | * @param int $day Day number |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | public function getWeekDay($day) |
||
162 | } |
||
163 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.