From 6186d5527668c2593915e4bf3558d3484652331f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ha=C5=82as?= Date: Thu, 30 Apr 2026 21:12:07 +0200 Subject: [PATCH 1/2] fix(ci): upgrade actions/checkout from v2 to v6.0.2 with SHA pinning - Update tests.yaml: v2 -> v6.0.2 (lines 12, 82) - Update release.yaml: v4.2.2 -> v6.0.2 (line 17) - Use SHA pinning for supply chain security Fixes #148 --- .github/workflows/release.yaml | 2 +- .github/workflows/tests.yaml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1d19243..c018062 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: fetch-depth: 0 diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6b02730..83fa864 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -79,7 +79,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Setup PHP uses: shivammathur/setup-php@v2 From 21324d7603f61f40fc269539c56b5c21f81778a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Ha=C5=82as?= Date: Thu, 30 Apr 2026 21:15:38 +0200 Subject: [PATCH 2/2] fix(Scheduler): remove useless assert() in PeriodicalTrigger DateInterval::createFromDateString() throws DateMalformedIntervalStringException on invalid input since PHP 8.2, so the try-catch block already handles errors. The assert() calls were redundant and caused PHPStan errors: - Call to function assert() with true will always evaluate to true - Instanceof between DateInterval and DateInterval will always evaluate to true --- src/Scheduler/Trigger/PeriodicalTrigger.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Scheduler/Trigger/PeriodicalTrigger.php b/src/Scheduler/Trigger/PeriodicalTrigger.php index 9f7ba7d..582a4ba 100644 --- a/src/Scheduler/Trigger/PeriodicalTrigger.php +++ b/src/Scheduler/Trigger/PeriodicalTrigger.php @@ -15,17 +15,13 @@ public function __construct(string|int|\DateInterval $interval) { try { if (is_int($interval)) { - $dateTime = \DateInterval::createFromDateString(sprintf('%d seconds', $interval)); - assert($dateTime instanceof \DateInterval); - $this->interval = $dateTime; + $this->interval = \DateInterval::createFromDateString(sprintf('%d seconds', $interval)); $this->description = sprintf('every %s', $interval); } elseif (\is_string($interval) && str_starts_with($interval, 'P')) { $this->interval = new \DateInterval($interval); $this->description = sprintf('DateInterval (%s)', $interval); } elseif (\is_string($interval)) { - $dateTime = \DateInterval::createFromDateString($interval); - assert($dateTime instanceof \DateInterval); - $this->interval = $dateTime; + $this->interval = \DateInterval::createFromDateString($interval); $this->description = sprintf('every %s', $interval); } else { $this->interval = $interval;