From d298983b15d20560c0194c5ed269ff5f0d9ef19a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Sun, 18 Feb 2024 10:48:02 +0100 Subject: [PATCH] Enhancement: Add support for PHP 7.0 --- .github/settings.yml | 2 ++ .github/workflows/integrate.yaml | 8 +++++++- .php-cs-fixer.php | 2 +- CHANGELOG.md | 2 ++ composer.json | 4 ++-- composer.lock | 4 ++-- psalm-baseline.xml | 14 +++++++++++++- psalm.xml | 1 + rector.php | 4 ++-- test/Unit/FrozenClockTest.php | 2 +- test/Unit/SystemClockTest.php | 4 ++-- 11 files changed, 35 insertions(+), 12 deletions(-) diff --git a/.github/settings.yml b/.github/settings.yml index 530817c..9e23cba 100644 --- a/.github/settings.yml +++ b/.github/settings.yml @@ -21,6 +21,8 @@ branches: - context: "Refactoring (7.4, locked)" - context: "Security Analysis (7.4, locked)" - context: "Static Code Analysis (7.4, locked)" + - context: "Tests (7.0, highest)" + - context: "Tests (7.0, locked)" - context: "Tests (7.1, highest)" - context: "Tests (7.1, locked)" - context: "Tests (7.2, highest)" diff --git a/.github/workflows/integrate.yaml b/.github/workflows/integrate.yaml index b2e5668..df98e31 100644 --- a/.github/workflows/integrate.yaml +++ b/.github/workflows/integrate.yaml @@ -429,6 +429,12 @@ jobs: - "highest" include: + - php-version: "7.0" + dependencies: "lowest" + + - php-version: "7.0" + dependencies: "highest" + - php-version: "7.1" dependencies: "lowest" @@ -487,7 +493,7 @@ jobs: - name: "Require phpunit/phpunit" if: "matrix.dependencies != 'locked'" - run: "composer require phpunit/phpunit:\"^7.5.20 || ^8.5.19 || ^9.6.16\" --ansi --dev --no-interaction --no-progress" + run: "composer require phpunit/phpunit:\"^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.6.16\" --ansi --dev --no-interaction --no-progress" - name: "Install ${{ matrix.dependencies }} dependencies with composer" uses: "ergebnis/.github/actions/composer/install@1.9.0" diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index 2c1f1d7..6fb3875 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -26,7 +26,7 @@ $license->save(); -$ruleSet = PhpCsFixer\Config\RuleSet\Php71::create()->withHeader($license->header()); +$ruleSet = PhpCsFixer\Config\RuleSet\Php70::create()->withHeader($license->header()); $config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet); diff --git a/CHANGELOG.md b/CHANGELOG.md index e93a44d..9e35a6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ For a full diff see [`2.7.0...main`][2.7.0...main]. - Added support for PHP 7.3 ([#758]), by [@localheinz] - Added support for PHP 7.2 ([#759]), by [@localheinz] - Added support for PHP 7.1 ([#760]), by [@localheinz] +- Added support for PHP 7.0 ([#761]), by [@localheinz] ## [`2.7.0`][2.7.0] @@ -176,6 +177,7 @@ For a full diff see [`36912f6...1.0.0`][36912f6...1.0.0]. [#758]: https://github.com/ergebnis/clock/pull/758 [#759]: https://github.com/ergebnis/clock/pull/759 [#760]: https://github.com/ergebnis/clock/pull/760 +[#761]: https://github.com/ergebnis/clock/pull/761 [@ergebnis]: https://github.com/ergebnis [@localheinz]: https://github.com/localheinz diff --git a/composer.json b/composer.json index b74bc2e..055747e 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ "source": "https://github.com/ergebnis/clock" }, "require": { - "php": "~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", + "php": "~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0", "psr/clock": "^1.0.0" }, "require-dev": { @@ -29,7 +29,7 @@ "ergebnis/license": "^2.4.0", "ergebnis/php-cs-fixer-config": "^6.22.0", "infection/infection": "~0.26.6", - "phpunit/phpunit": "^7.5.20 || ^8.5.19 || ^9.6.16", + "phpunit/phpunit": "^6.5.14 || ^7.5.20 || ^8.5.19 || ^9.6.16", "psalm/plugin-phpunit": "~0.18.4", "rector/rector": "^1.0.1", "vimeo/psalm": "^5.22.1" diff --git a/composer.lock b/composer.lock index aa64f24..e24ae81 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "eb95caddf6391be9470d387bfe9aad67", + "content-hash": "e9f27cdabec09788426056943e2619d9", "packages": [ { "name": "psr/clock", @@ -6324,7 +6324,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" + "php": "~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0" }, "platform-dev": [], "platform-overrides": { diff --git a/psalm-baseline.xml b/psalm-baseline.xml index c537d28..3ff1b9e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,2 +1,14 @@ - + + + + + + + + + + + + + diff --git a/psalm.xml b/psalm.xml index 0071365..608831b 100644 --- a/psalm.xml +++ b/psalm.xml @@ -9,6 +9,7 @@ findUnusedBaselineEntry="true" findUnusedCode="true" findUnusedVariablesAndParams="true" + phpVersion="7.4.0" resolveFromConfigFile="true" strictBinaryOperands="true" > diff --git a/rector.php b/rector.php index a9ae41f..5992ab9 100644 --- a/rector.php +++ b/rector.php @@ -15,7 +15,7 @@ use Rector\PHPUnit; use Rector\ValueObject; -return static function (Config\RectorConfig $rectorConfig): void { +return static function (Config\RectorConfig $rectorConfig) { $rectorConfig->cacheDirectory(__DIR__ . '/.build/rector/'); $rectorConfig->paths([ @@ -23,7 +23,7 @@ __DIR__ . '/test/', ]); - $rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_71); + $rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_70); $rectorConfig->sets([ PHPUnit\Set\PHPUnitSetList::PHPUNIT_70, diff --git a/test/Unit/FrozenClockTest.php b/test/Unit/FrozenClockTest.php index 19165ab..a77eea6 100644 --- a/test/Unit/FrozenClockTest.php +++ b/test/Unit/FrozenClockTest.php @@ -21,7 +21,7 @@ */ final class FrozenClockTest extends Framework\TestCase { - public function testNowReturnsInitializeDateTime(): void + public function testNowReturnsInitializeDateTime() { $now = new \DateTimeImmutable(); diff --git a/test/Unit/SystemClockTest.php b/test/Unit/SystemClockTest.php index f8cb28a..3081c57 100644 --- a/test/Unit/SystemClockTest.php +++ b/test/Unit/SystemClockTest.php @@ -24,7 +24,7 @@ */ final class SystemClockTest extends Framework\TestCase { - public function testNowReturnsCurrentDateTime(): void + public function testNowReturnsCurrentDateTime() { $timeZone = new \DateTimeZone('Europe/Berlin'); @@ -46,7 +46,7 @@ public function testNowReturnsCurrentDateTime(): void self::assertLessThanOrEqual($after, $now); } - public function testFreezeReturnsFrozenClock(): void + public function testFreezeReturnsFrozenClock() { $timeZone = new \DateTimeZone('Europe/Berlin');