1 | <?php |
||
5 | trait TimeTypeTrait |
||
6 | { |
||
7 | /** |
||
8 | * Extracts time parts from the given string. |
||
9 | * |
||
10 | * Will return an object with 3 properties, hours, minutes, seconds with the values from the string. Each property |
||
11 | * defaults to zero. If the string cannot be parsed, return null. |
||
12 | * |
||
13 | * @param $value |
||
14 | * |
||
15 | * @return ?\stdClass |
||
|
|||
16 | */ |
||
17 | 57 | protected function extractTimeParts($value): ?\stdClass |
|
49 | |||
50 | /** |
||
51 | * Handles HHHMMSS formatted strings. |
||
52 | * |
||
53 | * @param string $timeString |
||
54 | * @param \stdClass $extractedParts |
||
55 | * |
||
56 | * @return null|\stdClass |
||
57 | */ |
||
58 | private function handleNonDelimitedString(string $timeString, \stdClass $extractedParts) |
||
73 | |||
74 | /** |
||
75 | * Validates that the string can represent seconds. |
||
76 | * |
||
77 | * @param string $seconds |
||
78 | * |
||
79 | * @return bool |
||
80 | */ |
||
81 | protected function validateSeconds(string $seconds): bool |
||
93 | |||
94 | /** |
||
95 | * Validates that the string can represent minutes. |
||
96 | * |
||
97 | * @param string $minutes |
||
98 | * |
||
99 | * @return bool |
||
100 | */ |
||
101 | protected function validateMinutes(string $minutes): bool |
||
107 | |||
108 | /** |
||
109 | * Validates tha the string can represent hours. |
||
110 | * |
||
111 | * @param string $hours |
||
112 | * |
||
113 | * @return bool |
||
114 | */ |
||
115 | protected function validateHours(string $hours): bool |
||
121 | } |
||
122 |
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.