From 12293d3f5bf1cc1623055ec663c22ede89195c5d Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 6 Mar 2024 20:20:10 +0300 Subject: [PATCH 1/6] Added Symfony 7 support --- .github/workflows/phpunit.yml | 5 +++-- .gitignore | 1 + composer.json | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index b04e4c2..e99a19a 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -9,8 +9,9 @@ jobs: fail-fast: true matrix: php: [ "7.3", "7.4", "8.0", "8.1" ] + symfony: [ "4.0", "5.0", "6.0", "7.0" ] - name: PHP ${{ matrix.php }} + name: PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }} steps: - name: Checkout code @@ -24,7 +25,7 @@ jobs: coverage: none - name: Install dependencies - run: composer update --prefer-stable --prefer-dist --no-progress --no-interaction + run: composer require symfony/http-foundation:^${{ matrix.symfony }} --prefer-dist --no-progress --no-interaction - name: Execute tests run: sudo vendor/bin/phpunit diff --git a/.gitignore b/.gitignore index 19640c6..cbfed89 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +build/ node_modules/ vendor/ diff --git a/composer.json b/composer.json index d8f7485..61cd157 100644 --- a/composer.json +++ b/composer.json @@ -40,11 +40,11 @@ "ext-json": "*", "dragon-code/contracts": "^2.17", "dragon-code/support": "^5.0 || ^6.0", - "symfony/http-foundation": "^4.0 || ^5.0 || ^6.0" + "symfony/http-foundation": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "require-dev": { "phpunit/phpunit": "^9.6", - "symfony/var-dumper": "^4.3 || ^5.4 || ^6.0" + "symfony/var-dumper": "^4.3 || ^5.4 || ^6.0 || ^7.0" }, "conflict": { "andrey-helldar/simple-data-transfer-object": "*" From cd9288b262a95355e9e31b0eb6f834760c9a4f72 Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 6 Mar 2024 20:24:33 +0300 Subject: [PATCH 2/6] Update exclude rules --- .github/workflows/phpunit.yml | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index e99a19a..deb6e0a 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -8,8 +8,41 @@ jobs: strategy: fail-fast: true matrix: - php: [ "7.3", "7.4", "8.0", "8.1" ] + php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ] symfony: [ "4.0", "5.0", "6.0", "7.0" ] + exclude: + - php: "8.2" + symfony: "4.0" + + - php: "8.3" + symfony: "4.0" + + - php: "8.2" + symfony: "5.0" + + - php: "8.3" + symfony: "5.0" + + - php: "7.3" + symfony: "6.0" + + - php: "7.4" + symfony: "6.0" + + - php: "8.0" + symfony: "6.0" + + - php: "7.3" + symfony: "7.0" + + - php: "7.4" + symfony: "7.0" + + - php: "8.0" + symfony: "7.0" + + - php: "8.1" + symfony: "7.0" name: PHP ${{ matrix.php }}, Symfony ${{ matrix.symfony }} From b9f20a0d53ffc4cc0fb94d9dd6ea200ba67930bd Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 6 Mar 2024 20:25:11 +0300 Subject: [PATCH 3/6] Update exclude rules --- .github/workflows/phpunit.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index deb6e0a..20a731e 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -11,6 +11,9 @@ jobs: php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ] symfony: [ "4.0", "5.0", "6.0", "7.0" ] exclude: + - php: "8.1" + symfony: "4.0" + - php: "8.2" symfony: "4.0" From d4777c6bd2ae4e446a8cac15ea312f04e94ec80e Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 6 Mar 2024 20:26:11 +0300 Subject: [PATCH 4/6] Update exclude rules --- .github/workflows/phpunit.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/phpunit.yml b/.github/workflows/phpunit.yml index 20a731e..43c554c 100644 --- a/.github/workflows/phpunit.yml +++ b/.github/workflows/phpunit.yml @@ -11,6 +11,12 @@ jobs: php: [ "7.3", "7.4", "8.0", "8.1", "8.2", "8.3" ] symfony: [ "4.0", "5.0", "6.0", "7.0" ] exclude: + - php: "7.4" + symfony: "4.0" + + - php: "8.0" + symfony: "4.0" + - php: "8.1" symfony: "4.0" From 61643852ad055a6d91fc2d6d1309209daf8eb44e Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 6 Mar 2024 20:29:24 +0300 Subject: [PATCH 5/6] Update exclude rules --- tests/Unit/FromTest.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/Unit/FromTest.php b/tests/Unit/FromTest.php index c17c79d..5b7511a 100644 --- a/tests/Unit/FromTest.php +++ b/tests/Unit/FromTest.php @@ -76,6 +76,12 @@ public function testObjectArrayable() public function testRequest() { + if (!method_exists(Request::class, 'toArray')) { + $this->assertTrue(true); + + return; + } + $content = json_encode([ 'foo' => $this->foo, 'bar' => $this->bar, From b050b2e8daaaecd3408f4127c71cdaf9006f983b Mon Sep 17 00:00:00 2001 From: Andrey Helldar Date: Wed, 6 Mar 2024 20:30:22 +0300 Subject: [PATCH 6/6] Fixed code-style --- tests/Unit/FromTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Unit/FromTest.php b/tests/Unit/FromTest.php index 5b7511a..c3449a9 100644 --- a/tests/Unit/FromTest.php +++ b/tests/Unit/FromTest.php @@ -76,7 +76,7 @@ public function testObjectArrayable() public function testRequest() { - if (!method_exists(Request::class, 'toArray')) { + if (! method_exists(Request::class, 'toArray')) { $this->assertTrue(true); return;