Skip to content

Commit

Permalink
Merge pull request #761 from ergebnis/feature/php70
Browse files Browse the repository at this point in the history
Enhancement: Add support for PHP 7.0
  • Loading branch information
localheinz committed Feb 18, 2024
2 parents 8e0e9ce + d298983 commit 954d86b
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/settings.yml
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.0, highest)"
- context: "Tests (7.0, locked)"
- context: "Tests (7.1, highest)"
- context: "Tests (7.1, locked)"
- context: "Tests (7.2, highest)"
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/integrate.yaml
Expand Up @@ -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"

Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion .php-cs-fixer.php
Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -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]

Expand Down Expand Up @@ -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
4 changes: 2 additions & 2 deletions composer.json
Expand Up @@ -21,15 +21,15 @@
"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": {
"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": "^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"
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.

14 changes: 13 additions & 1 deletion psalm-baseline.xml
@@ -1,2 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.22.1@e9dad66e11274315dac27e08349c628c7d6a1a43"/>
<files psalm-version="5.22.1@e9dad66e11274315dac27e08349c628c7d6a1a43">
<file src="test/Unit/FrozenClockTest.php">
<MissingReturnType>
<code><![CDATA[testNowReturnsInitializeDateTime]]></code>
</MissingReturnType>
</file>
<file src="test/Unit/SystemClockTest.php">
<MissingReturnType>
<code><![CDATA[testFreezeReturnsFrozenClock]]></code>
<code><![CDATA[testNowReturnsCurrentDateTime]]></code>
</MissingReturnType>
</file>
</files>
1 change: 1 addition & 0 deletions psalm.xml
Expand Up @@ -9,6 +9,7 @@
findUnusedBaselineEntry="true"
findUnusedCode="true"
findUnusedVariablesAndParams="true"
phpVersion="7.4.0"
resolveFromConfigFile="true"
strictBinaryOperands="true"
>
Expand Down
4 changes: 2 additions & 2 deletions rector.php
Expand Up @@ -15,15 +15,15 @@
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([
__DIR__ . '/src/',
__DIR__ . '/test/',
]);

$rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_71);
$rectorConfig->phpVersion(ValueObject\PhpVersion::PHP_70);

$rectorConfig->sets([
PHPUnit\Set\PHPUnitSetList::PHPUNIT_70,
Expand Down
2 changes: 1 addition & 1 deletion test/Unit/FrozenClockTest.php
Expand Up @@ -21,7 +21,7 @@
*/
final class FrozenClockTest extends Framework\TestCase
{
public function testNowReturnsInitializeDateTime(): void
public function testNowReturnsInitializeDateTime()
{
$now = new \DateTimeImmutable();

Expand Down
4 changes: 2 additions & 2 deletions test/Unit/SystemClockTest.php
Expand Up @@ -24,7 +24,7 @@
*/
final class SystemClockTest extends Framework\TestCase
{
public function testNowReturnsCurrentDateTime(): void
public function testNowReturnsCurrentDateTime()
{
$timeZone = new \DateTimeZone('Europe/Berlin');

Expand All @@ -46,7 +46,7 @@ public function testNowReturnsCurrentDateTime(): void
self::assertLessThanOrEqual($after, $now);
}

public function testFreezeReturnsFrozenClock(): void
public function testFreezeReturnsFrozenClock()
{
$timeZone = new \DateTimeZone('Europe/Berlin');

Expand Down

0 comments on commit 954d86b

Please sign in to comment.