Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ci fixes #194

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
php: [7.2, 7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]

steps:
- name: Checkout
Expand Down
2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
parameters:
checkMissingIterableValueType: false

ignoreErrors:
- '#Call to an undefined method DateTimeInterface::add\(\)#'
Expand All @@ -8,6 +7,7 @@ parameters:
- '#Call to an undefined method DateTimeInterface::setTime\(\)#'
- '#Call to an undefined method DateTimeInterface::setTimezone\(\)#'
- '#Call to an undefined method DateTimeInterface::sub\(\)#'
- identifier: missingType.iterableValue
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image


level: max

Expand Down
3 changes: 3 additions & 0 deletions src/Cron/AbstractField.php
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ public function isInIncrementsOfRanges(int $dateValue, string $value): bool
return false;
}

$step = (int)$step;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

// Expand the * to a full range
if ('*' === $range) {
$range = $this->rangeStart . '-' . $this->rangeEnd;
Expand Down Expand Up @@ -217,6 +219,7 @@ public function getRangeForExpression(string $expression, int $max): array
$offset = $range[0];
$to = $range[1] ?? $max;
}
$stepSize = (int)$stepSize;
$offset = '*' === $offset ? $this->rangeStart : $offset;
if ($stepSize >= $this->rangeEnd) {
$values = [$this->fullRange[$stepSize % \count($this->fullRange)]];
Expand Down
2 changes: 1 addition & 1 deletion src/Cron/DayOfWeekField.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function isSatisfiedBy(DateTimeInterface $date, $value, bool $invert): bo

// Find out if this is the last specific weekday of the month
if ($lPosition = strpos($value, 'L')) {
$weekday = $this->convertLiterals(substr($value, 0, $lPosition));
$weekday = (int)$this->convertLiterals(substr($value, 0, $lPosition));
$weekday %= 7;

$daysInMonth = (int) $date->format('t');
Expand Down