From 99dffe97b4ba3907e5e50acf50d4e88fd1bbc86a Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 18:54:39 +0100 Subject: [PATCH 1/9] Update dependencies --- .github/workflows/run-tests.yml | 6 ++-- .gitignore | 1 + README.md | 26 +++++++-------- composer.json | 8 ++--- phpunit.xml.dist | 57 +++++++++++++++++---------------- tests/Pest.php | 2 +- 6 files changed, 53 insertions(+), 47 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index d0b4613..b49973e 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -38,8 +38,8 @@ jobs: strategy: fail-fast: false matrix: - php: [ 8.0, 8.1, 8.2 ] - laravel: [ 8.*, 9.*, 10.* ] + php: [ 8.0, 8.1, 8.2, 8.3 ] + laravel: [ 8.*, 9.*, 10.*, 11.* ] include: - laravel: 8.* testbench: 6.* @@ -47,6 +47,8 @@ jobs: testbench: 7.* - laravel: 10.* testbench: 8.* + - laravel: 11.* + testbench: 9.* exclude: - php: 8.0 laravel: 10.* diff --git a/.gitignore b/.gitignore index 2391b68..f7d09b1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ composer.lock phpinsights.json coverage.xml composer.phar +/.phpunit.cache/ diff --git a/README.md b/README.md index 163eb9f..7b69082 100644 --- a/README.md +++ b/README.md @@ -196,19 +196,19 @@ composer test ## 🔰 Version Support -| Larex | L5.8 | L6.x | L7.x | L8.x | L9.x | L10.x | -|:----------------:|:----:|:----:|:----:|:----:|:----:|:-----:| -| ^1.0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | -| ^1.2 | ^2.0 | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | -| ^3.0 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | -| ^4.0 | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | - -| Larex | PHP7.2 | PHP7.3 | PHP7.4 | PHP8.0 | PHP8.1 | PHP8.2 | -|:----------------:|:------:|:------:|:------:|:------:|:------:|:------:| -| ^1.0 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | -| ^1.6 | ^2.0 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | -| ^3.0 | ❌ | ❌ | ✅ | ✅ | ✅ | ❌ | -| ^4.0 | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | +| Larex | L5.8 | L6.x | L7.x | L8.x | L9.x | L10.x | L11.x | +|:----------------:|:----:|:----:|:----:|:----:|:----:|:-----:|-------| +| ^1.0 | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | +| ^1.2 | ^2.0 | ❌ | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | +| ^3.0 | ❌ | ❌ | ✅ | ✅ | ❌ | ❌ | ❌ | +| ^4.0 | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | + +| Larex | PHP7.2 | PHP7.3 | PHP7.4 | PHP8.0 | PHP8.1 | PHP8.2 | PHP8.3 | +|:----------------:|:------:|:------:|:------:|:------:|:------:|:------:|--------| +| ^1.0 | ✅ | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | +| ^1.6 | ^2.0 | ❌ | ✅ | ✅ | ✅ | ✅ | ❌ | ❌ | +| ^3.0 | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ✅ | +| ^4.0 | ❌ | ❌ | ❌ | ✅ | ✅ | ✅ | ✅ | ## 📃 Changelog diff --git a/composer.json b/composer.json index b03129e..eeab607 100644 --- a/composer.json +++ b/composer.json @@ -24,16 +24,16 @@ "php": "^8.0", "ext-dom": "*", "ext-json": "*", - "illuminate/support": "^8.0|^9.0|^10.0", + "illuminate/support": "^8.0|^9.0|^10.0|^11.0", "loilo/fuse": "^6.4.6", "spatie/simple-excel": "^3.0.1", "spatie/laravel-collection-macros": "^7.12" }, "require-dev": { - "orchestra/testbench": "^6.0|^7.0|^8.0", - "pestphp/pest": "^1.21", + "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", + "pestphp/pest": "^2.0", "psalm/plugin-laravel": "^2.0", - "vimeo/psalm": "^4.24" + "vimeo/psalm": "^5.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 46616e3..6ce5ee7 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,29 +1,32 @@ - - - - tests - - - - - src/ - - src/Support - - - - - - + + + + + tests + + + + + + + + + + src/ + + + src/Support + + + diff --git a/tests/Pest.php b/tests/Pest.php index d23edf1..3e8213d 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -56,7 +56,7 @@ | */ -expect()->extend('fileContent', fn () => $this->and(File::get($this->value))); +expect()->extend('fileContent', fn () => $this->and($this->value = File::get($this->value))); expect()->extend('toEqualStub', fn (string $name, $eol = "\n") => $this->toEqual(getTestStub($name, $eol))); /* From 67ad60f2e2301ee28dfb2540a8e60a56544129e6 Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 19:02:08 +0100 Subject: [PATCH 2/9] Revert pest version --- composer.json | 2 +- phpunit.xml.dist | 57 +++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/composer.json b/composer.json index eeab607..f08fd78 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "require-dev": { "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", - "pestphp/pest": "^2.0", + "pestphp/pest": "^v1.23.1", "psalm/plugin-laravel": "^2.0", "vimeo/psalm": "^5.0" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 6ce5ee7..46616e3 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,32 +1,29 @@ - - - - - tests - - - - - - - - - - src/ - - - src/Support - - - + + + + tests + + + + + src/ + + src/Support + + + + + + From d79f6c17775db6a4836a664aa362166903913b46 Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 19:06:56 +0100 Subject: [PATCH 3/9] Fix workflow --- .github/workflows/run-tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b49973e..9658ee8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -52,6 +52,10 @@ jobs: exclude: - php: 8.0 laravel: 10.* + - php: 8.0 + laravel: 11.* + - php: 8.1 + laravel: 11.* name: Laravel ${{ matrix.laravel }} with PHP ${{ matrix.php }} From fb5f46c3f5ac406f9c36b608b1b2465b92115de4 Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 19:13:14 +0100 Subject: [PATCH 4/9] Fix workflow x2 --- .github/workflows/run-tests.yml | 11 +++-------- composer.json | 1 + 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 9658ee8..e6fb8e7 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -63,12 +63,6 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Cache dependencies - uses: actions/cache@v1 - with: - path: ~/.composer/cache/files - key: php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }} - - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -77,8 +71,9 @@ jobs: - name: Install dependencies run: | - composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update - composer update --prefer-dist --no-interaction --no-suggest + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update + composer require "orchestra/testbench:${{ matrix.testbench }}" --dev --no-interaction --no-update + composer update --prefer-dist --no-interaction - name: Execute tests run: composer run-script test diff --git a/composer.json b/composer.json index f08fd78..c777ec0 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ "require-dev": { "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", "pestphp/pest": "^v1.23.1", + "phpunit/phpunit": "^9.6.10", "psalm/plugin-laravel": "^2.0", "vimeo/psalm": "^5.0" }, From c1952621a9492d51000ecbec2c0a9062310c8148 Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 19:16:56 +0100 Subject: [PATCH 5/9] Fix workflow x3 --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index c777ec0..2cea270 100644 --- a/composer.json +++ b/composer.json @@ -32,8 +32,7 @@ "require-dev": { "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", "pestphp/pest": "^v1.23.1", - "phpunit/phpunit": "^9.6.10", - "psalm/plugin-laravel": "^2.0", + "phpunit/phpunit": "^9.0|^10.0", "vimeo/psalm": "^5.0" }, "autoload": { From 49f03c212b990d455b446a394d43cd0cb9826400 Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 19:26:08 +0100 Subject: [PATCH 6/9] Fix workflow x4 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 2cea270..943d729 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,7 @@ }, "require-dev": { "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", - "pestphp/pest": "^v1.23.1", + "pestphp/pest": "^v1.0|^v2.0", "phpunit/phpunit": "^9.0|^10.0", "vimeo/psalm": "^5.0" }, From b0fbd9dda89b5fc423e8a0e378f8b48d05f17733 Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 19:27:20 +0100 Subject: [PATCH 7/9] Fix workflow x5 --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 943d729..41dbbeb 100644 --- a/composer.json +++ b/composer.json @@ -32,7 +32,6 @@ "require-dev": { "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", "pestphp/pest": "^v1.0|^v2.0", - "phpunit/phpunit": "^9.0|^10.0", "vimeo/psalm": "^5.0" }, "autoload": { From a295e640622f0e8bc473dbb1d4a31d9837501a0f Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 19:49:49 +0100 Subject: [PATCH 8/9] Fix psalm --- composer.json | 1 + psalm.xml | 2 +- src/Console/LarexInsertCommand.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 41dbbeb..c45cdeb 100644 --- a/composer.json +++ b/composer.json @@ -32,6 +32,7 @@ "require-dev": { "orchestra/testbench": "^6.0|^7.0|^8.0|^9.0", "pestphp/pest": "^v1.0|^v2.0", + "psalm/plugin-laravel": "^2.0", "vimeo/psalm": "^5.0" }, "autoload": { diff --git a/psalm.xml b/psalm.xml index c3026f0..b5a37f9 100644 --- a/psalm.xml +++ b/psalm.xml @@ -1,6 +1,6 @@ skip(2)->values(); //initialize data + /** @var Collection $data */ $data = collect([]); //iterate until user confirm the inserted data From bb2f3a2d04abcff45f1d97bdebb38ce6dcbdf311 Mon Sep 17 00:00:00 2001 From: Luca Patera Date: Thu, 14 Mar 2024 19:55:01 +0100 Subject: [PATCH 9/9] Fix workflow x6 --- .github/workflows/run-tests.yml | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index e6fb8e7..7df0107 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -17,17 +17,7 @@ jobs: - name: Validate composer.json and composer.lock run: composer validate - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-${{ hashFiles('**/composer.json') }} - restore-keys: | - ${{ runner.os }}-php- - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' run: composer install --no-progress --no-ansi - name: Run Psalm @@ -88,27 +78,17 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: 8.2 + php-version: 8.0 coverage: xdebug - name: Validate composer.json and composer.lock run: composer validate - - name: Cache Composer packages - id: composer-cache - uses: actions/cache@v2 - with: - path: vendor - key: ${{ runner.os }}-php-8.2-${{ hashFiles('**/composer.json') }} - restore-keys: | - ${{ runner.os }}-php-8.2- - - name: Install dependencies - if: steps.composer-cache.outputs.cache-hit != 'true' - run: composer install --prefer-dist --no-interaction --no-suggest + run: composer install --prefer-dist --no-interaction - name: Run test suite - uses: paambaati/codeclimate-action@v3.2.0 + uses: paambaati/codeclimate-action@v5.0.0 env: CC_TEST_REPORTER_ID: ${{ secrets.CC_REPORTER_ID }} with: