diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2e3b3c9..55b2a68 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,11 @@ jobs: strategy: fail-fast: false matrix: - php: ['7.4'] - dependencies: [highest, lowest] + php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5'] + dependencies: [highest] + include: + - php: '7.4' + dependencies: lowest steps: - uses: actions/checkout@v6 @@ -25,6 +28,9 @@ jobs: php-version: ${{ matrix.php }} tools: composer:v2 + - name: Align composer platform.php with matrix PHP version + run: composer config platform.php ${{ matrix.php }} + - name: Install dependencies uses: ramsey/composer-install@v4 with: diff --git a/composer.json b/composer.json index edf8ab6..e2349e7 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ } ], "require": { - "php": "^7.4", + "php": "^7.4 || ^8.0", "symfony/console": "^3.4 | ^4.0 | ^5.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 1f1065c..2da5391 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": "ad3c92c419ec035c3134e447270994bb", + "content-hash": "45bd62a296a29299ed7ec69b6e2332f7", "packages": [ { "name": "psr/container", @@ -2951,7 +2951,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.4" + "php": "^7.4 || ^8.0" }, "platform-dev": {}, "platform-overrides": { diff --git a/src/Diff/ConsoleDiff.php b/src/Diff/ConsoleDiff.php index b9e5693..0197c5b 100644 --- a/src/Diff/ConsoleDiff.php +++ b/src/Diff/ConsoleDiff.php @@ -28,7 +28,7 @@ class ConsoleDiff extends FirstDiff * * @param CursorInterface|null $cursor The cursor used to move around the screen */ - public function __construct(CursorInterface $cursor = null) + public function __construct(?CursorInterface $cursor = null) { $this->cursor = $cursor ?: new ANSI(); } diff --git a/src/DiffConsoleOutput.php b/src/DiffConsoleOutput.php index 7fb3e91..97cb9fd 100644 --- a/src/DiffConsoleOutput.php +++ b/src/DiffConsoleOutput.php @@ -49,8 +49,8 @@ class DiffConsoleOutput implements OutputInterface */ public function __construct( OutputInterface $output, - TerminalInterface $terminal = null, - Wrapper $wrapper = null + ?TerminalInterface $terminal = null, + ?Wrapper $wrapper = null ) { $this->output = $output; $this->terminal = $terminal ?: new Terminal(); diff --git a/src/Terminal/Terminal.php b/src/Terminal/Terminal.php index b57d59b..a3293d1 100644 --- a/src/Terminal/Terminal.php +++ b/src/Terminal/Terminal.php @@ -26,7 +26,7 @@ class Terminal implements TerminalInterface * @param CursorInterface|null $cursor * @param DimensionsInterface $dimensions */ - public function __construct(CursorInterface $cursor = null, DimensionsInterface $dimensions = null) + public function __construct(?CursorInterface $cursor = null, ?DimensionsInterface $dimensions = null) { $this->cursor = $cursor ?: new ANSI(); $this->dimensions = $dimensions ?: new TerminalDimensions();