Skip to content

Commit

Permalink
Updates for PHPUnit 10 and PHP 7.4/8.0 deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
poliander committed Nov 1, 2023
1 parent 0c0389c commit 765ca06
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php-version: ['7.4', '8.0', '8.1', '8.2']
php-version: ['8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v3
Expand All @@ -17,7 +17,7 @@ jobs:
- name: PHPUnit Tests
uses: php-actions/phpunit@master
with:
version: 9.6
version: 10
bootstrap: vendor/autoload.php
configuration: phpunit.xml.dist
args: --coverage-text
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
}
],
"require": {
"php": "7.4.* || 8.0.* || 8.1.* || 8.2.*"
"php": "8.1.* || 8.2.* || 8.3.*"
},
"require-dev": {
"phpunit/phpunit": "~9.0"
"phpunit/phpunit": "~10.0"
},
"autoload": {
"psr-4": {
Expand Down
13 changes: 7 additions & 6 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage>
<include>
<directory>src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd">
<coverage/>
<testsuites>
<testsuite name="Cron Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory>src</directory>
</include>
</source>
</phpunit>
13 changes: 6 additions & 7 deletions src/Cron/CronExpression.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,20 +77,19 @@ class CronExpression
];

/**
* Time zone
*
* @var DateTimeZone|null
*/
protected $timeZone = null;
protected readonly ?DateTimeZone $timeZone;

/**
* Matching registers
*
* @var array|null
*/
protected $registers = null;
protected readonly ?array $registers;

protected $expression;
/**
* @var string
*/
protected readonly string $expression;

/**
* @param string $expression a cron expression, e.g. "* * * * *"
Expand Down
4 changes: 2 additions & 2 deletions tests/Cron/CronExpressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function testParser(string $expression, bool $valid = false, string $when
/**
* @return array
*/
public function parserTestProvider()
public static function parserTestProvider()
{
return [
["* * * * *", true, 'now', true],
Expand Down Expand Up @@ -163,7 +163,7 @@ public function testGetNext(string $expression, int $timestampCurrent, int $time
/**
* @return array
*/
public function getNextProvider()
public static function getNextProvider()
{
return [
['* * 13 * fri', 1400407467, 1402610400],
Expand Down

0 comments on commit 765ca06

Please sign in to comment.