Skip to content

Commit 96122ce

Browse files
committed
refactor: isDue => checkDue
1 parent dfd625f commit 96122ce

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Expression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function isCronDue($expr, $time = null)
8787
continue;
8888
}
8989

90-
if (!$checker->isDue($segment, $pos, $time)) {
90+
if (!$checker->checkDue($segment, $pos, $time)) {
9191
return false;
9292
}
9393
}

src/SegmentChecker.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ public function __construct()
2828
*
2929
* @return bool
3030
*/
31-
public function isDue($segment, $pos, $time)
31+
public function checkDue($segment, $pos, $time)
3232
{
3333
$isDue = true;
3434
$offsets = \explode(',', \trim($segment));
3535

3636
foreach ($offsets as $offset) {
3737
if (null === $isDue = $this->isOffsetDue($offset, $pos, $time)) {
3838
throw new \UnexpectedValueException(
39-
sprintf('Invalid offset value %s for segment #%d', $offset, $pos)
39+
sprintf('Invalid offset value at segment #%d: %s', $pos, $offset)
4040
);
4141
}
4242

@@ -86,8 +86,6 @@ protected function checkModifier($offset, $pos, $time)
8686
return $this->validator->isValidWeekDay($offset, $time);
8787
}
8888

89-
// @codeCoverageIgnoreStart
90-
return !$isModifier;
91-
// @codeCoverageIgnoreEnd
89+
return null;
9290
}
9391
}

0 commit comments

Comments
 (0)