Skip to content

Commit

Permalink
Enhancement: Add support for PHP 7.2
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Feb 18, 2024
1 parent a9a8f18 commit a335032
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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.2, highest)"
- context: "Tests (7.2, locked)"
- context: "Tests (7.3, highest)"
- context: "Tests (7.3, locked)"
- context: "Tests (7.4, highest)"
Expand Down
12 changes: 11 additions & 1 deletion .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,12 @@ jobs:
- "highest"

include:
- php-version: "7.2"
dependencies: "lowest"

- php-version: "7.2"
dependencies: "highest"

- php-version: "7.3"
dependencies: "lowest"

Expand Down Expand Up @@ -471,7 +477,11 @@ jobs:

- name: "Remove incompatible dependencies with composer"
if: "matrix.dependencies != 'locked'"
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config infection/infection psalm/plugin-phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"
run: "composer remove ergebnis/composer-normalize ergebnis/license ergebnis/php-cs-fixer-config infection/infection psalm/plugin-phpunit phpunit/phpunit vimeo/psalm --ansi --dev --no-interaction --no-progress"

- name: "Require phpunit/phpunit"
if: "matrix.dependencies != 'locked'"
run: "composer require phpunit/phpunit:\"^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"
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

$license->save();

$ruleSet = PhpCsFixer\Config\RuleSet\Php73::create()->withHeader($license->header());
$ruleSet = PhpCsFixer\Config\RuleSet\Php72::create()->withHeader($license->header());

$config = PhpCsFixer\Config\Factory::fromRuleSet($ruleSet);

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ For a full diff see [`2.7.0...main`][2.7.0...main].
- Added support for PHP 8.0 ([#756]), by [@localheinz]
- Added support for PHP 7.4 ([#757]), by [@localheinz]
- Added support for PHP 7.3 ([#758]), by [@localheinz]
- Added support for PHP 7.2 ([#759]), by [@localheinz]

## [`2.7.0`][2.7.0]

Expand Down Expand Up @@ -172,6 +173,7 @@ For a full diff see [`36912f6...1.0.0`][36912f6...1.0.0].
[#756]: https://github.com/ergebnis/clock/pull/756
[#757]: https://github.com/ergebnis/clock/pull/757
[#758]: https://github.com/ergebnis/clock/pull/758
[#759]: https://github.com/ergebnis/clock/pull/759

[@ergebnis]: https://github.com/ergebnis
[@localheinz]: https://github.com/localheinz
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@
"source": "https://github.com/ergebnis/clock"
},
"require": {
"php": "~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0",
"php": "~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": {
"ergebnis/composer-normalize": "^2.42.0",
"ergebnis/license": "^2.4.0",
"ergebnis/php-cs-fixer-config": "^6.22.0",
"infection/infection": "~0.26.6",
"phpunit/phpunit": "^9.6.16",
"phpunit/phpunit": "^8.5.19 || ^9.6.16",
"psalm/plugin-phpunit": "~0.18.4",
"rector/rector": "^1.0.1",
"vimeo/psalm": "^5.22.1"
Expand Down
4 changes: 2 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
__DIR__ . '/test/',
]);

$rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_73);
$rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_72);

$rectorConfig->sets([
PHPUnit\Set\PHPUnitSetList::PHPUNIT_90,
PHPUnit\Set\PHPUnitSetList::PHPUNIT_80,
]);
};
2 changes: 1 addition & 1 deletion src/SystemClock.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function now(): \DateTimeImmutable
{
return new \DateTimeImmutable(
'now',
$this->timezone,
$this->timezone
);
}

Expand Down
8 changes: 4 additions & 4 deletions test/Unit/SystemClockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ public function testNowReturnsCurrentDateTime(): void

$before = new \DateTimeImmutable(
'now',
$timeZone,
$timeZone
);

$now = $clock->now();

$after = new \DateTimeImmutable(
'now',
$timeZone,
$timeZone
);

self::assertGreaterThanOrEqual($before, $now);
Expand All @@ -54,14 +54,14 @@ public function testFreezeReturnsFrozenClock(): void

$before = new \DateTimeImmutable(
'now',
$timeZone,
$timeZone
);

$frozenClock = $clock->freeze();

$after = new \DateTimeImmutable(
'now',
$timeZone,
$timeZone
);

self::assertInstanceOf(FrozenClock::class, $frozenClock);
Expand Down

0 comments on commit a335032

Please sign in to comment.