From ce3cd1e62960004da252eae6289811f135cd3e52 Mon Sep 17 00:00:00 2001 From: Travis Carden Date: Tue, 2 Apr 2024 04:55:04 -0400 Subject: [PATCH] Make compatible with Symfony 7. --- .github/workflows/main.yml | 27 ++++++++--------- composer.json | 4 +-- composer.lock | 30 +++++++++---------- .../Service/ExecutableFinderUnitTest.php | 6 ++-- 4 files changed, 32 insertions(+), 35 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cb238000..92320f28 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,7 +28,7 @@ jobs: - name: "Set up PHP" uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action with: - php-version: "8.1" + php-version: "8.2" coverage: none - name: "Checkout code" @@ -41,20 +41,20 @@ jobs: run: "composer static" tests: - name: "Test: ${{ matrix.os }} / deps-${{ matrix.dependencies }}" - runs-on: "${{ matrix.os }}" + name: "Test: ${{ matrix.os }} / ${{ matrix.php }} / ${{ matrix.dependencies }}" + runs-on: "${{ matrix.os }}-latest" strategy: fail-fast: false matrix: - os: [ ubuntu-latest, macos-latest, windows-latest ] - php: [ "8.1" ] + os: [ ubuntu, macos, windows ] + php: [ "8.1", "8.2" ] dependencies: [ lowest, highest ] steps: - name: "Install rsync" uses: GuillaumeFalourd/setup-rsync@v1.2 # https://github.com/marketplace/actions/setup-rsync - name: "Set up PHP w/ Coverage" - if: ${{ matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' }} + if: ${{ matrix.os == 'ubuntu' && matrix.dependencies == 'highest' }} uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action with: php-version: "${{ matrix.php }}" @@ -62,7 +62,7 @@ jobs: ini-values: assert.active=1, assert.exception=1, zend.assertions=1 - name: "Set up PHP w/o Coverage" - if: ${{ !( matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' ) }} + if: ${{ !( matrix.os == 'ubuntu' && matrix.dependencies == 'highest' ) }} uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action with: php-version: "${{ matrix.php }}" @@ -85,12 +85,12 @@ jobs: - name: "Run core tests with coverage" run: "composer test" - if: ${{ matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' }} + if: ${{ matrix.os == 'ubuntu' && matrix.dependencies == 'highest' }} # There's no reason to generate coverage data on multiple jobs--the result should be the same. - name: "Run core tests without coverage" run: "./vendor/bin/phpunit --no-coverage --exclude-group=windows_only" - if: ${{ runner.os != 'Windows' && !( matrix.os == 'ubuntu-latest' && matrix.dependencies == 'highest' ) }} + if: ${{ runner.os != 'Windows' && !( matrix.os == 'ubuntu' && matrix.dependencies == 'highest' ) }} - name: "Run Windows tests" run: "./vendor/bin/phpunit --no-coverage --exclude-group=no_windows" @@ -98,12 +98,11 @@ jobs: performance: name: "Performance: ${{ matrix.os }}" - runs-on: "${{ matrix.os }}" + runs-on: "${{ matrix.os }}-latest" strategy: fail-fast: false matrix: - os: [ ubuntu-latest, windows-latest ] - php: [ "8.1" ] + os: [ ubuntu, windows ] steps: - name: "Install rsync" uses: GuillaumeFalourd/setup-rsync@v1.2 # https://github.com/marketplace/actions/setup-rsync @@ -111,7 +110,7 @@ jobs: - name: "Set up PHP" uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action with: - php-version: "8.1" + php-version: "8.2" coverage: none - name: "Checkout code" @@ -130,7 +129,7 @@ jobs: - name: "Set up PHP" uses: shivammathur/setup-php@v2 # https://github.com/marketplace/actions/setup-php-action with: - php-version: "8.1" + php-version: "8.2" extensions: gd ini-values: assert.active=1, assert.exception=1, zend.assertions=1 diff --git a/composer.json b/composer.json index 19f7ad8a..d533f64e 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ "require": { "php": ">=8.1.0", "ext-json": "*", - "symfony/filesystem": "^6.2", - "symfony/process": "^6.2", + "symfony/filesystem": "^6.2 || ^7.0", + "symfony/process": "^6.2 || ^7.0", "symfony/translation-contracts": "^3.1" }, "require-dev": { diff --git a/composer.lock b/composer.lock index f2afaebc..8ec86163 100644 --- a/composer.lock +++ b/composer.lock @@ -4,24 +4,24 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "97698e2f77f2c8711e6320f031e12724", + "content-hash": "36b9b4adabf7332caef5a90206bb468d", "packages": [ { "name": "symfony/filesystem", - "version": "v6.4.3", + "version": "v7.0.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb" + "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", - "reference": "7f3b1755eb49297a0827a7575d5d2b2fd11cc9fb", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/2890e3a825bc0c0558526c04499c13f83e1b6b12", + "reference": "2890e3a825bc0c0558526c04499c13f83e1b6b12", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, @@ -51,7 +51,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.3" + "source": "https://github.com/symfony/filesystem/tree/v7.0.3" }, "funding": [ { @@ -67,7 +67,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T14:51:35+00:00" + "time": "2024-01-23T15:02:46+00:00" }, { "name": "symfony/polyfill-ctype", @@ -230,20 +230,20 @@ }, { "name": "symfony/process", - "version": "v6.4.4", + "version": "v7.0.4", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "710e27879e9be3395de2b98da3f52a946039f297" + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/710e27879e9be3395de2b98da3f52a946039f297", - "reference": "710e27879e9be3395de2b98da3f52a946039f297", + "url": "https://api.github.com/repos/symfony/process/zipball/0e7727191c3b71ebec6d529fa0e50a01ca5679e9", + "reference": "0e7727191c3b71ebec6d529fa0e50a01ca5679e9", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -271,7 +271,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v6.4.4" + "source": "https://github.com/symfony/process/tree/v7.0.4" }, "funding": [ { @@ -287,7 +287,7 @@ "type": "tidelift" } ], - "time": "2024-02-20T12:31:00+00:00" + "time": "2024-02-22T20:27:20+00:00" }, { "name": "symfony/translation-contracts", diff --git a/tests/Finder/Service/ExecutableFinderUnitTest.php b/tests/Finder/Service/ExecutableFinderUnitTest.php index 3e9fda0e..3be7b45f 100644 --- a/tests/Finder/Service/ExecutableFinderUnitTest.php +++ b/tests/Finder/Service/ExecutableFinderUnitTest.php @@ -41,8 +41,7 @@ public function testFind(): void $command = 'command_name'; $this->symfonyExecutableFinder ->addSuffix('.phar') - ->shouldBeCalled() - ->willReturn(null); + ->shouldBeCalled(); $this->symfonyExecutableFinder ->find($command) ->shouldBeCalledOnce() @@ -60,8 +59,7 @@ public function testFindNotFound(): void $command = 'command_name'; $this->symfonyExecutableFinder ->addSuffix('.phar') - ->shouldBeCalledOnce() - ->willReturn(null); + ->shouldBeCalledOnce(); $this->symfonyExecutableFinder ->find($command) ->shouldBeCalledOnce()