From 94acced90642441218bf08e0edf99d288eea24ae Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 11 Dec 2023 17:27:30 +0100 Subject: [PATCH 1/4] chore(php): drop eol 8.0; add 8.3 --- .github/workflows/php.yml | 4 ++-- composer.json | 4 ++-- readme.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index e502b81..39e9bf5 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -8,10 +8,10 @@ jobs: strategy: matrix: operating-system: [ ubuntu-latest ] - php-versions: [ '8.0', '8.1', '8.2' ] + php-versions: [ '8.1', '8.2', '8.3' ] experimental: [ false ] include: - - php-versions: '8.3' + - php-versions: '8.4' operating-system: ubuntu-latest experimental: true fail-fast: false diff --git a/composer.json b/composer.json index 736fc7a..e68f5cb 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,7 @@ } ], "require": { - "php": ">=8.0.0" + "php": ">=8.1.0" }, "suggest": { "ext-dom": "for timezone tool" @@ -28,6 +28,6 @@ "test": "tester tests -s -p php" }, "require-dev": { - "nette/tester": "^2.4" + "nette/tester": "^2.5.1" } } diff --git a/readme.md b/readme.md index 6666c10..a1126b9 100644 --- a/readme.md +++ b/readme.md @@ -66,7 +66,7 @@ php -S localhost:8000 -t example ## Requirements -- PHP 8.0+ +- PHP 8.1+ ## Run tests From 803987d4a48a10e4a25fb9f920d34cd297ea3c93 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 11 Dec 2023 17:27:30 +0100 Subject: [PATCH 2/4] chore(actions): update version --- .github/workflows/php.yml | 2 +- .github/workflows/typo.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 39e9bf5..b26af3f 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -18,7 +18,7 @@ jobs: runs-on: ${{ matrix.operating-system }} continue-on-error: ${{ matrix.experimental }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 diff --git a/.github/workflows/typo.yml b/.github/workflows/typo.yml index 97d55a2..1dbf013 100644 --- a/.github/workflows/typo.yml +++ b/.github/workflows/typo.yml @@ -6,7 +6,7 @@ jobs: name: Check for typos / misspells runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Run misspell with reviewdog uses: reviewdog/action-misspell@v1 From cc96cf07ebb043d0a0b7f7051331c37ad1cff15c Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 11 Dec 2023 17:27:31 +0100 Subject: [PATCH 3/4] chore(migration): add access modifier to member var --- src/Freq.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Freq.php b/src/Freq.php index 7d98846..7ef74bf 100644 --- a/src/Freq.php +++ b/src/Freq.php @@ -37,7 +37,7 @@ class Freq { /** @var bool */ - static bool $debug = false; + public static bool $debug = false; protected array $weekdays = [ 'MO' => 'monday', From 78cdc06749be9bd2b8402e6dc6ce7e85a94792b2 Mon Sep 17 00:00:00 2001 From: Rotzbua Date: Mon, 11 Dec 2023 17:27:31 +0100 Subject: [PATCH 4/4] chore(cs): fix new line --- src/Freq.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/Freq.php b/src/Freq.php index 7ef74bf..892d8c9 100644 --- a/src/Freq.php +++ b/src/Freq.php @@ -212,12 +212,8 @@ public function findNext(int $offset): bool|int { //set the timestamp of the offset (ignoring hours and minutes unless we want them to be //part of the calculations. if (static::$debug) printf("O: %s\n", date('r', $offset)); - $hour = (in_array($this->freq, ['hourly', 'minutely']) && $offset > $this->start) ? date('H', $offset) : date( - 'H', $this->start - ); - $minute = (($this->freq === 'minutely' || isset($this->rules['byminute'])) && $offset > $this->start) ? date( - 'i', $offset - ) : date('i', $this->start); + $hour = (in_array($this->freq, ['hourly', 'minutely']) && $offset>$this->start) ? date('H', $offset) : date('H', $this->start); + $minute = (($this->freq === 'minutely' || isset($this->rules['byminute'])) && $offset > $this->start) ? date('i', $offset) : date('i', $this->start); $t = mktime($hour, $minute, date('s', $this->start), date('m', $offset), date('d', $offset), date('Y', $offset)); if (static::$debug) printf("START: %s\n", date('r', $t));