@@ -53,7 +53,7 @@ public function inStep(int $value, string $offset): bool
53
53
return false ;
54
54
}
55
55
56
- if (\strpos ($ offset , '*/ ' ) !== false || \strpos ($ offset , '0/ ' ) !== false ) {
56
+ if (\strpos ($ offset , '*/ ' ) === 0 || \strpos ($ offset , '0/ ' ) === 0 ) {
57
57
return $ value % $ parts [1 ] === 0 ;
58
58
}
59
59
@@ -91,7 +91,7 @@ public function inStepRange(int $value, int $start, int $end, int $step): bool
91
91
* @internal
92
92
*
93
93
* @param string $value
94
- * @param ReferenceTime $time
94
+ * @param ReferenceTime $reference
95
95
*
96
96
* @return bool
97
97
*/
@@ -140,7 +140,7 @@ protected function isClosestWeekDay(int $value, string $month, ReferenceTime $re
140
140
* @internal
141
141
*
142
142
* @param string $value
143
- * @param ReferenceTime $time
143
+ * @param ReferenceTime $reference
144
144
*
145
145
* @return bool
146
146
*/
@@ -156,16 +156,18 @@ public function isValidWeekDay(string $value, ReferenceTime $reference): bool
156
156
$ this ->unexpectedValue (4 , $ value );
157
157
}
158
158
159
- list ($ day , $ nth ) = \explode ('# ' , \str_replace ('0 # ' , '7 # ' , $ value ));
159
+ list ($ day , $ nth ) = \explode ('# ' , \str_replace ('7 # ' , '0 # ' , $ value ));
160
160
161
- if (!$ this ->isNthWeekDay ((int ) $ day , (int ) $ nth ) || $ reference ->weekDay1 () != $ day ) {
161
+ if (!$ this ->isNthWeekDay ((int ) $ day , (int ) $ nth ) || $ reference ->weekDay () != $ day ) {
162
162
return false ;
163
163
}
164
164
165
165
return \intval ($ reference ->day () / 7 ) == $ nth - 1 ;
166
166
}
167
167
168
168
/**
169
+ * Throws UnexpectedValueException.
170
+ *
169
171
* @param int $pos
170
172
* @param string $value
171
173
*
0 commit comments