Skip to content

Commit

Permalink
Merge pull request #74 from Rotzbua/chore_php_version
Browse files Browse the repository at this point in the history
chore: update php version
  • Loading branch information
OzzyCzech authored Dec 12, 2023
2 parents 1e68aae + 78cdc06 commit 5830e95
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ 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
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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": ">=8.0.0"
"php": ">=8.1.0"
},
"suggest": {
"ext-dom": "for timezone tool"
Expand All @@ -28,6 +28,6 @@
"test": "tester tests -s -p php"
},
"require-dev": {
"nette/tester": "^2.4"
"nette/tester": "^2.5.1"
}
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ php -S localhost:8000 -t example

## Requirements

- PHP 8.0+
- PHP 8.1+

## Run tests

Expand Down
10 changes: 3 additions & 7 deletions src/Freq.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
class Freq {

/** @var bool */
static bool $debug = false;
public static bool $debug = false;

protected array $weekdays = [
'MO' => 'monday',
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 5830e95

Please sign in to comment.