Skip to content

Commit

Permalink
Drop support for PHP 8.1 (#608)
Browse files Browse the repository at this point in the history
  • Loading branch information
martin-georgiev authored Mar 22, 2024
1 parent 375b0a0 commit 5b8ccc9
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 33 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- "highest"
- "locked"
php-version:
- "8.1"
- "8.2"
- "8.3"
operating-system:
Expand All @@ -41,7 +40,7 @@ jobs:
ini-values: memory_limit=-1

- name: "Update Composer platform version"
if: ${{ matrix.dependencies != 'locked' && matrix.php-version != '8.1' }}
if: ${{ matrix.dependencies != 'locked' && matrix.php-version != '8.2' }}
shell: bash
run: "composer config platform.php ${{ matrix.php-version }}"

Expand All @@ -63,7 +62,7 @@ jobs:
run: "composer audit"

- name: "Run coding style"
if: ${{ matrix.dependencies == 'locked' && matrix.php-version == '8.1' }}
if: ${{ matrix.dependencies == 'locked' && matrix.php-version == '8.2' }}
run: "composer code-style:check"

- name: "Run PHPStan"
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile.php-cli
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM lendableuk/php-fpm-alpine:8.1.11-alpine3.15
ARG PHP_BASE_IMAGE_VERSION="8.2.5-alpine3.17"

FROM lendableuk/php-fpm-alpine:${PHP_BASE_IMAGE_VERSION}

COPY --from=composer:2.7.2 /usr/bin/composer /usr/bin/composer

Expand Down
7 changes: 2 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
}
},
"require": {
"php": ">=8.1",
"php": ">=8.2",
"psr/clock": "^1.0"
},
"require-dev": {
"infection/infection": "^0.27.10",
"infection/infection": "^0.27.11",
"lendable/composer-license-checker": "^1.1.1",
"liuggio/fastest": "^1.8",
"mikey179/vfsstream": "^1.6.11",
Expand All @@ -44,9 +44,6 @@
"config": {
"bin-dir": "bin",
"sort-packages": true,
"platform": {
"php": "8.1.15"
},
"allow-plugins": {
"infection/extension-installer": true
}
Expand Down
22 changes: 9 additions & 13 deletions composer.lock

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

8 changes: 4 additions & 4 deletions lib/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@

use Lendable\Clock\Date\InvalidDate;

final class Date
final readonly class Date
{
private function __construct(
private readonly int $year,
private readonly int $month,
private readonly int $day,
private int $year,
private int $month,
private int $day,
) {
if (!\checkdate($month, $day, $year)) {
throw InvalidDate::fromDate($year, $month, $day);
Expand Down
4 changes: 2 additions & 2 deletions lib/Serialization/FastestTestChannelFileNameGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
* prevent conflicts when running a test suite that divides and conquers test cases
* into parallel execution streams via liuggio/fastest.
*/
final class FastestTestChannelFileNameGenerator implements FileNameGenerator
final readonly class FastestTestChannelFileNameGenerator implements FileNameGenerator
{
private readonly string $fileName;
private string $fileName;

public function __construct()
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Serialization/FixedFileNameGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
/**
* Always generates the same configurable file name.
*/
final class FixedFileNameGenerator implements FileNameGenerator
final readonly class FixedFileNameGenerator implements FileNameGenerator
{
public function __construct(private readonly string $fileName = 'now.json')
public function __construct(private string $fileName = 'now.json')
{
}

Expand Down
4 changes: 2 additions & 2 deletions lib/SystemClock.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
/**
* Delegates through to PHP to obtain the current system time in a fixed timezone.
*/
final class SystemClock implements Clock
final readonly class SystemClock implements Clock
{
private const DEFAULT_TIMEZONE = 'UTC';

public function __construct(private readonly \DateTimeZone $timeZone = new \DateTimeZone(self::DEFAULT_TIMEZONE))
public function __construct(private \DateTimeZone $timeZone = new \DateTimeZone(self::DEFAULT_TIMEZONE))
{
}

Expand Down
2 changes: 1 addition & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
->withPaths([__DIR__.'/lib', __DIR__.'/tests'])
->withRootFiles()
->withPHPStanConfigs([__DIR__.'/phpstan-rector.neon'])
->withPhpSets(php81: true)
->withPhpSets(php82: true)
->withPreparedSets(codeQuality: true)
->withAttributesSets(phpunit: true)
->withSets([PHPUnitSetList::PHPUNIT_100]);

0 comments on commit 5b8ccc9

Please sign in to comment.