@@ -33,17 +33,17 @@ public function __construct()
3333 *
3434 * @param string $segment
3535 * @param int $pos
36- * @param int $time
36+ * @param array $times
3737 *
3838 * @return bool
3939 */
40- public function checkDue ($ segment , $ pos , $ time )
40+ public function checkDue ($ segment , $ pos , $ times )
4141 {
4242 $ isDue = true ;
4343 $ offsets = \explode (', ' , \trim ($ segment ));
4444
4545 foreach ($ offsets as $ offset ) {
46- if (null === $ isDue = $ this ->isOffsetDue ($ offset , $ pos , $ time )) {
46+ if (null === $ isDue = $ this ->isOffsetDue ($ offset , $ pos , $ times )) {
4747 throw new \UnexpectedValueException (
4848 sprintf ('Invalid offset value at segment #%d: %s ' , $ pos , $ offset )
4949 );
@@ -62,37 +62,37 @@ public function checkDue($segment, $pos, $time)
6262 *
6363 * @param string $offset
6464 * @param int $pos
65- * @param array $time
65+ * @param array $times
6666 *
6767 * @return bool|null
6868 */
69- protected function isOffsetDue ($ offset , $ pos , $ time )
69+ protected function isOffsetDue ($ offset , $ pos , $ times )
7070 {
7171 if (\strpos ($ offset , '/ ' ) !== false ) {
72- return $ this ->validator ->inStep ($ time [$ pos ], $ offset );
72+ return $ this ->validator ->inStep ($ times [$ pos ], $ offset );
7373 }
7474
7575 if (\strpos ($ offset , '- ' ) !== false ) {
76- return $ this ->validator ->inRange ($ time [$ pos ], $ offset );
76+ return $ this ->validator ->inRange ($ times [$ pos ], $ offset );
7777 }
7878
7979 if (\is_numeric ($ offset )) {
80- return $ time [$ pos ] == $ offset ;
80+ return $ times [$ pos ] == $ offset ;
8181 }
8282
83- return $ this ->checkModifier ($ offset , $ pos , $ time );
83+ return $ this ->checkModifier ($ offset , $ pos , $ times );
8484 }
8585
86- protected function checkModifier ($ offset , $ pos , $ time )
86+ protected function checkModifier ($ offset , $ pos , $ times )
8787 {
8888 $ isModifier = \strpbrk ($ offset , 'LCW# ' );
8989
9090 if ($ pos === 2 && $ isModifier ) {
91- return $ this ->validator ->isValidMonthDay ($ offset , $ time );
91+ return $ this ->validator ->isValidMonthDay ($ offset , $ times );
9292 }
9393
9494 if ($ pos === 4 && $ isModifier ) {
95- return $ this ->validator ->isValidWeekDay ($ offset , $ time );
95+ return $ this ->validator ->isValidWeekDay ($ offset , $ times );
9696 }
9797
9898 return null ;
0 commit comments