1 | <?php |
||
11 | class Time implements ValidateRuleInterface |
||
12 | { |
||
13 | /** |
||
14 | * Indicates if the given field's value is a MySql safe Time. |
||
15 | * |
||
16 | * @param object $subject |
||
17 | * @param string $field |
||
18 | * |
||
19 | * @return bool |
||
20 | */ |
||
21 | 36 | public function __invoke($subject, string $field): bool |
|
31 | |||
32 | /** |
||
33 | * Extracts time parts from the given string. |
||
34 | * |
||
35 | * Will return an object with 3 properties, hours, minutes, seconds with the values from the string. Each property |
||
36 | * defaults to zero. If the string cannot be parsed, return null. |
||
37 | * |
||
38 | * @param $value |
||
39 | * @return ?\stdClass |
||
|
|||
40 | */ |
||
41 | 36 | protected function extractTimeParts($value): ?\stdClass |
|
73 | |||
74 | protected function handleNonDelimitedString(string $timeString, \stdClass $extractedParts) |
||
89 | |||
90 | /** |
||
91 | * Validates that the string can represent seconds. |
||
92 | * |
||
93 | * @param string $seconds |
||
94 | * |
||
95 | * @return bool |
||
96 | */ |
||
97 | 27 | protected function validateSeconds(string $seconds): bool |
|
109 | |||
110 | /** |
||
111 | * Validates that the string can represent minutes. |
||
112 | * |
||
113 | * @param string $minutes |
||
114 | * |
||
115 | * @return bool |
||
116 | */ |
||
117 | 27 | protected function validateMinutes(string $minutes): bool |
|
123 | |||
124 | /** |
||
125 | * Validates tha the string can represent hours. |
||
126 | * |
||
127 | * @param string $hours |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | 33 | protected function validateHours(string $hours): bool |
|
137 | } |
||
138 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.