From 8a3bbf27c611e15506f0d9a7db3269fcb519b305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20S=2E=20Campos?= Date: Sat, 16 Dec 2023 22:33:40 -0500 Subject: [PATCH] chore: upgrade to php 8.2 --- .../workflows/default-api-admin-testing.yml | 2 +- .../default-api-analytics-testing.yml | 2 +- .github/workflows/default-api-testing.yml | 2 +- .github/workflows/default-console-testing.yml | 2 +- .../default-external-api-testing.yml | 2 +- .github/workflows/default-unit-testing.yml | 2 +- .github/workflows/default-web-testing.yml | 2 +- .github/workflows/develop-phpstan-src.yml | 2 +- .github/workflows/develop-phpstan-tests.yml | 2 +- .github/workflows/develop-testing-feature.yml | 2 +- .github/workflows/develop-testing-unit.yml | 2 +- .github/workflows/master-php-cs-fixer.yml | 2 +- .github/workflows/master-php-insights.yml | 2 +- .github/workflows/master-phpstan.yml | 2 +- .github/workflows/master-rector.yml | 2 +- .github/workflows/master-testing.yml | 2 +- composer.json | 2 +- composer.lock | 178 +++++++++--------- docker-compose.yml | 2 +- rector.php | 2 +- src/Domain/Rating/Events/ModelRated.php | 8 +- ...lidScore.php => InvalidScoreException.php} | 2 +- src/Domain/Rating/Factories/RatingFactory.php | 4 +- src/Domain/Rating/Utils/CanRate.php | 6 +- .../ExternalApi/ExternalApiService.php | 12 +- tests/Unit/Rating/Models/RatingTest.php | 4 +- 26 files changed, 126 insertions(+), 126 deletions(-) rename src/Domain/Rating/Exceptions/{InvalidScore.php => InvalidScoreException.php} (93%) diff --git a/.github/workflows/default-api-admin-testing.yml b/.github/workflows/default-api-admin-testing.yml index a56d326..3bc8c77 100644 --- a/.github/workflows/default-api-admin-testing.yml +++ b/.github/workflows/default-api-admin-testing.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/default-api-analytics-testing.yml b/.github/workflows/default-api-analytics-testing.yml index ab31138..773d0a6 100644 --- a/.github/workflows/default-api-analytics-testing.yml +++ b/.github/workflows/default-api-analytics-testing.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/default-api-testing.yml b/.github/workflows/default-api-testing.yml index 9579a16..e9d9bfe 100644 --- a/.github/workflows/default-api-testing.yml +++ b/.github/workflows/default-api-testing.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/default-console-testing.yml b/.github/workflows/default-console-testing.yml index 9c0d43a..7378a4e 100644 --- a/.github/workflows/default-console-testing.yml +++ b/.github/workflows/default-console-testing.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/default-external-api-testing.yml b/.github/workflows/default-external-api-testing.yml index ba6ecf8..c32f751 100644 --- a/.github/workflows/default-external-api-testing.yml +++ b/.github/workflows/default-external-api-testing.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/default-unit-testing.yml b/.github/workflows/default-unit-testing.yml index 885f2fb..cfd6775 100644 --- a/.github/workflows/default-unit-testing.yml +++ b/.github/workflows/default-unit-testing.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/default-web-testing.yml b/.github/workflows/default-web-testing.yml index 089967d..59c794b 100644 --- a/.github/workflows/default-web-testing.yml +++ b/.github/workflows/default-web-testing.yml @@ -42,7 +42,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/develop-phpstan-src.yml b/.github/workflows/develop-phpstan-src.yml index fa9da7e..b484a39 100644 --- a/.github/workflows/develop-phpstan-src.yml +++ b/.github/workflows/develop-phpstan-src.yml @@ -19,7 +19,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/develop-phpstan-tests.yml b/.github/workflows/develop-phpstan-tests.yml index 792628e..9e3e468 100644 --- a/.github/workflows/develop-phpstan-tests.yml +++ b/.github/workflows/develop-phpstan-tests.yml @@ -19,7 +19,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/develop-testing-feature.yml b/.github/workflows/develop-testing-feature.yml index 5add260..51d827f 100644 --- a/.github/workflows/develop-testing-feature.yml +++ b/.github/workflows/develop-testing-feature.yml @@ -44,7 +44,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/develop-testing-unit.yml b/.github/workflows/develop-testing-unit.yml index a728e5d..91aa445 100644 --- a/.github/workflows/develop-testing-unit.yml +++ b/.github/workflows/develop-testing-unit.yml @@ -41,7 +41,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/.github/workflows/master-php-cs-fixer.yml b/.github/workflows/master-php-cs-fixer.yml index 95656cb..89563e4 100644 --- a/.github/workflows/master-php-cs-fixer.yml +++ b/.github/workflows/master-php-cs-fixer.yml @@ -19,7 +19,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/master-php-insights.yml b/.github/workflows/master-php-insights.yml index bfe2554..936728a 100644 --- a/.github/workflows/master-php-insights.yml +++ b/.github/workflows/master-php-insights.yml @@ -17,7 +17,7 @@ jobs: - uses: actions/checkout@v2 - uses: shivammathur/setup-php@v2 with: - php-version: 8.1 + php-version: 8.2 - run: composer install --prefer-dist --no-progress --no-suggest # TODO: Increase metrics - run: vendor/bin/phpinsights --min-quality=85 --min-complexity=85 --min-architecture=75 --min-style=90 -n --ansi --format=github-action diff --git a/.github/workflows/master-phpstan.yml b/.github/workflows/master-phpstan.yml index 71888dd..dc7dc1e 100644 --- a/.github/workflows/master-phpstan.yml +++ b/.github/workflows/master-phpstan.yml @@ -20,7 +20,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/master-rector.yml b/.github/workflows/master-rector.yml index 92747ae..b2287bd 100644 --- a/.github/workflows/master-rector.yml +++ b/.github/workflows/master-rector.yml @@ -19,7 +19,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' coverage: none - name: Install composer dependencies diff --git a/.github/workflows/master-testing.yml b/.github/workflows/master-testing.yml index 8722015..ea64725 100644 --- a/.github/workflows/master-testing.yml +++ b/.github/workflows/master-testing.yml @@ -44,7 +44,7 @@ jobs: steps: - uses: shivammathur/setup-php@v2 with: - php-version: '8.1' + php-version: '8.2' extensions: mbstring, dom, fileinfo, mysql coverage: xdebug diff --git a/composer.json b/composer.json index 60f11a7..22c0662 100644 --- a/composer.json +++ b/composer.json @@ -21,7 +21,7 @@ } ], "require": { - "php": "^8.1", + "php": "^8.2", "guzzlehttp/guzzle": "^7.5", "laravel-lang/lang": "~8.0", "laravel/framework": "^10.0", diff --git a/composer.lock b/composer.lock index df03dd7..814ee33 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": "ee4d3eb001439ed606b53f32cf4e8ad7", + "content-hash": "b3b8da7c80bdd5b92708b95e8fba149e", "packages": [ { "name": "aws/aws-crt-php", @@ -2406,34 +2406,34 @@ }, { "name": "lcobucci/clock", - "version": "3.0.0", + "version": "3.2.0", "source": { "type": "git", "url": "https://github.com/lcobucci/clock.git", - "reference": "039ef98c6b57b101d10bd11d8fdfda12cbd996dc" + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lcobucci/clock/zipball/039ef98c6b57b101d10bd11d8fdfda12cbd996dc", - "reference": "039ef98c6b57b101d10bd11d8fdfda12cbd996dc", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/6f28b826ea01306b07980cb8320ab30b966cd715", + "reference": "6f28b826ea01306b07980cb8320ab30b966cd715", "shasum": "" }, "require": { - "php": "~8.1.0 || ~8.2.0", + "php": "~8.2.0 || ~8.3.0", "psr/clock": "^1.0" }, "provide": { "psr/clock-implementation": "1.0" }, "require-dev": { - "infection/infection": "^0.26", - "lcobucci/coding-standard": "^9.0", - "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.9.4", - "phpstan/phpstan-deprecation-rules": "^1.1.1", - "phpstan/phpstan-phpunit": "^1.3.2", - "phpstan/phpstan-strict-rules": "^1.4.4", - "phpunit/phpunit": "^9.5.27" + "infection/infection": "^0.27", + "lcobucci/coding-standard": "^11.0.0", + "phpstan/extension-installer": "^1.3.1", + "phpstan/phpstan": "^1.10.25", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.13", + "phpstan/phpstan-strict-rules": "^1.5.1", + "phpunit/phpunit": "^10.2.3" }, "type": "library", "autoload": { @@ -2454,7 +2454,7 @@ "description": "Yet another clock abstraction", "support": { "issues": "https://github.com/lcobucci/clock/issues", - "source": "https://github.com/lcobucci/clock/tree/3.0.0" + "source": "https://github.com/lcobucci/clock/tree/3.2.0" }, "funding": [ { @@ -2466,7 +2466,7 @@ "type": "patreon" } ], - "time": "2022-12-19T15:00:24+00:00" + "time": "2023-11-17T17:00:27+00:00" }, { "name": "lcobucci/jwt", @@ -6372,20 +6372,20 @@ }, { "name": "symfony/css-selector", - "version": "v6.4.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "d036c6c0d0b09e24a14a35f8292146a658f986e4" + "reference": "bb51d46e53ef8d50d523f0c5faedba056a27943e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/d036c6c0d0b09e24a14a35f8292146a658f986e4", - "reference": "d036c6c0d0b09e24a14a35f8292146a658f986e4", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/bb51d46e53ef8d50d523f0c5faedba056a27943e", + "reference": "bb51d46e53ef8d50d523f0c5faedba056a27943e", "shasum": "" }, "require": { - "php": ">=8.1" + "php": ">=8.2" }, "type": "library", "autoload": { @@ -6417,7 +6417,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v6.4.0" + "source": "https://github.com/symfony/css-selector/tree/v7.0.0" }, "funding": [ { @@ -6433,7 +6433,7 @@ "type": "tidelift" } ], - "time": "2023-10-31T08:40:20+00:00" + "time": "2023-10-31T17:59:56+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6579,24 +6579,24 @@ }, { "name": "symfony/event-dispatcher", - "version": "v6.4.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "d76d2632cfc2206eecb5ad2b26cd5934082941b6" + "reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/d76d2632cfc2206eecb5ad2b26cd5934082941b6", - "reference": "d76d2632cfc2206eecb5ad2b26cd5934082941b6", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/c459b40ffe67c49af6fd392aac374c9edf8a027e", + "reference": "c459b40ffe67c49af6fd392aac374c9edf8a027e", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/event-dispatcher-contracts": "^2.5|^3" }, "conflict": { - "symfony/dependency-injection": "<5.4", + "symfony/dependency-injection": "<6.4", "symfony/service-contracts": "<2.5" }, "provide": { @@ -6605,13 +6605,13 @@ }, "require-dev": { "psr/log": "^1|^2|^3", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/expression-language": "^5.4|^6.0|^7.0", - "symfony/http-foundation": "^5.4|^6.0|^7.0", + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/expression-language": "^6.4|^7.0", + "symfony/http-foundation": "^6.4|^7.0", "symfony/service-contracts": "^2.5|^3", - "symfony/stopwatch": "^5.4|^6.0|^7.0" + "symfony/stopwatch": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -6639,7 +6639,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v6.4.0" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.0" }, "funding": [ { @@ -6655,7 +6655,7 @@ "type": "tidelift" } ], - "time": "2023-07-27T06:52:43+00:00" + "time": "2023-07-27T16:29:09+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -8446,20 +8446,20 @@ }, { "name": "symfony/string", - "version": "v6.4.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "b45fcf399ea9c3af543a92edf7172ba21174d809" + "reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/b45fcf399ea9c3af543a92edf7172ba21174d809", - "reference": "b45fcf399ea9c3af543a92edf7172ba21174d809", + "url": "https://api.github.com/repos/symfony/string/zipball/92bd2bfbba476d4a1838e5e12168bef2fd1e6620", + "reference": "92bd2bfbba476d4a1838e5e12168bef2fd1e6620", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-intl-grapheme": "~1.0", "symfony/polyfill-intl-normalizer": "~1.0", @@ -8469,11 +8469,11 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { - "symfony/error-handler": "^5.4|^6.0|^7.0", - "symfony/http-client": "^5.4|^6.0|^7.0", - "symfony/intl": "^6.2|^7.0", + "symfony/error-handler": "^6.4|^7.0", + "symfony/http-client": "^6.4|^7.0", + "symfony/intl": "^6.4|^7.0", "symfony/translation-contracts": "^2.5|^3.0", - "symfony/var-exporter": "^5.4|^6.0|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -8512,7 +8512,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v6.4.0" + "source": "https://github.com/symfony/string/tree/v7.0.0" }, "funding": [ { @@ -8528,7 +8528,7 @@ "type": "tidelift" } ], - "time": "2023-11-28T20:41:49+00:00" + "time": "2023-11-29T08:40:23+00:00" }, { "name": "symfony/translation", @@ -14880,31 +14880,31 @@ }, { "name": "symfony/cache", - "version": "v6.4.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "ac2d25f97b17eec6e19760b6b9962a4f7c44356a" + "reference": "5e2376f726d61541b9617512e374808d12c1dc22" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/ac2d25f97b17eec6e19760b6b9962a4f7c44356a", - "reference": "ac2d25f97b17eec6e19760b6b9962a4f7c44356a", + "url": "https://api.github.com/repos/symfony/cache/zipball/5e2376f726d61541b9617512e374808d12c1dc22", + "reference": "5e2376f726d61541b9617512e374808d12c1dc22", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "psr/cache": "^2.0|^3.0", "psr/log": "^1.1|^2|^3", "symfony/cache-contracts": "^2.5|^3", "symfony/service-contracts": "^2.5|^3", - "symfony/var-exporter": "^6.3.6|^7.0" + "symfony/var-exporter": "^6.4|^7.0" }, "conflict": { - "doctrine/dbal": "<2.13.1", - "symfony/dependency-injection": "<5.4", - "symfony/http-kernel": "<5.4", - "symfony/var-dumper": "<5.4" + "doctrine/dbal": "<3.6", + "symfony/dependency-injection": "<6.4", + "symfony/http-kernel": "<6.4", + "symfony/var-dumper": "<6.4" }, "provide": { "psr/cache-implementation": "2.0|3.0", @@ -14913,15 +14913,15 @@ }, "require-dev": { "cache/integration-tests": "dev-master", - "doctrine/dbal": "^2.13.1|^3|^4", + "doctrine/dbal": "^3.6|^4", "predis/predis": "^1.1|^2.0", "psr/simple-cache": "^1.0|^2.0|^3.0", - "symfony/config": "^5.4|^6.0|^7.0", - "symfony/dependency-injection": "^5.4|^6.0|^7.0", - "symfony/filesystem": "^5.4|^6.0|^7.0", - "symfony/http-kernel": "^5.4|^6.0|^7.0", - "symfony/messenger": "^5.4|^6.0|^7.0", - "symfony/var-dumper": "^5.4|^6.0|^7.0" + "symfony/config": "^6.4|^7.0", + "symfony/dependency-injection": "^6.4|^7.0", + "symfony/filesystem": "^6.4|^7.0", + "symfony/http-kernel": "^6.4|^7.0", + "symfony/messenger": "^6.4|^7.0", + "symfony/var-dumper": "^6.4|^7.0" }, "type": "library", "autoload": { @@ -14956,7 +14956,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.4.0" + "source": "https://github.com/symfony/cache/tree/v7.0.0" }, "funding": [ { @@ -14972,7 +14972,7 @@ "type": "tidelift" } ], - "time": "2023-11-24T19:28:07+00:00" + "time": "2023-11-25T15:40:35+00:00" }, { "name": "symfony/cache-contracts", @@ -15052,20 +15052,20 @@ }, { "name": "symfony/filesystem", - "version": "v6.4.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59" + "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/952a8cb588c3bc6ce76f6023000fb932f16a6e59", - "reference": "952a8cb588c3bc6ce76f6023000fb932f16a6e59", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7da8ea2362a283771478c5f7729cfcb43a76b8b7", + "reference": "7da8ea2362a283771478c5f7729cfcb43a76b8b7", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.8" }, @@ -15095,7 +15095,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v6.4.0" + "source": "https://github.com/symfony/filesystem/tree/v7.0.0" }, "funding": [ { @@ -15111,24 +15111,24 @@ "type": "tidelift" } ], - "time": "2023-07-26T17:27:13+00:00" + "time": "2023-07-27T06:33:22+00:00" }, { "name": "symfony/options-resolver", - "version": "v6.4.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "22301f0e7fdeaacc14318928612dee79be99860e" + "reference": "700ff4096e346f54cb628ea650767c8130f1001f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/22301f0e7fdeaacc14318928612dee79be99860e", - "reference": "22301f0e7fdeaacc14318928612dee79be99860e", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/700ff4096e346f54cb628ea650767c8130f1001f", + "reference": "700ff4096e346f54cb628ea650767c8130f1001f", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/deprecation-contracts": "^2.5|^3" }, "type": "library", @@ -15162,7 +15162,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v6.4.0" + "source": "https://github.com/symfony/options-resolver/tree/v7.0.0" }, "funding": [ { @@ -15178,7 +15178,7 @@ "type": "tidelift" } ], - "time": "2023-08-08T10:16:24+00:00" + "time": "2023-08-08T10:20:21+00:00" }, { "name": "symfony/polyfill-php81", @@ -15261,20 +15261,20 @@ }, { "name": "symfony/stopwatch", - "version": "v6.4.0", + "version": "v7.0.0", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2" + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", - "reference": "fc47f1015ec80927ff64ba9094dfe8b9d48fe9f2", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", + "reference": "7bbfa3dd564a0ce12eb4acaaa46823c740f9cb7a", "shasum": "" }, "require": { - "php": ">=8.1", + "php": ">=8.2", "symfony/service-contracts": "^2.5|^3" }, "type": "library", @@ -15303,7 +15303,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v6.4.0" + "source": "https://github.com/symfony/stopwatch/tree/v7.0.0" }, "funding": [ { @@ -15319,7 +15319,7 @@ "type": "tidelift" } ], - "time": "2023-02-16T10:14:28+00:00" + "time": "2023-07-05T13:06:06+00:00" }, { "name": "symfony/var-exporter", @@ -15514,7 +15514,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": "^8.1" + "php": "^8.2" }, "platform-dev": [], "plugin-api-version": "2.6.0" diff --git a/docker-compose.yml b/docker-compose.yml index 5cb0fa8..98db837 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,7 @@ version: '3' services: laravel.test: build: - context: ./vendor/laravel/sail/runtimes/8.1 + context: ./vendor/laravel/sail/runtimes/8.2 dockerfile: Dockerfile args: WWWGROUP: '${WWWGROUP}' diff --git a/rector.php b/rector.php index 1e29479..2c44813 100644 --- a/rector.php +++ b/rector.php @@ -12,7 +12,7 @@ $rectorConfig->sets([ SetList::CODE_QUALITY, SetList::DEAD_CODE, - LevelSetList::UP_TO_PHP_81, + LevelSetList::UP_TO_PHP_82, LaravelSetList::LARAVEL_100 ]); }; diff --git a/src/Domain/Rating/Events/ModelRated.php b/src/Domain/Rating/Events/ModelRated.php index ec8a47b..668bdec 100644 --- a/src/Domain/Rating/Events/ModelRated.php +++ b/src/Domain/Rating/Events/ModelRated.php @@ -9,7 +9,7 @@ use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Queue\SerializesModels; -class ModelRated +readonly class ModelRated { use Dispatchable, InteractsWithSockets, SerializesModels; @@ -17,9 +17,9 @@ class ModelRated * Create a new event instance. */ public function __construct( - private readonly Model $qualifier, - private readonly Model $rateable, - private readonly ?int $score + private Model $qualifier, + private Model $rateable, + private ?int $score ) { } diff --git a/src/Domain/Rating/Exceptions/InvalidScore.php b/src/Domain/Rating/Exceptions/InvalidScoreException.php similarity index 93% rename from src/Domain/Rating/Exceptions/InvalidScore.php rename to src/Domain/Rating/Exceptions/InvalidScoreException.php index f4cec95..12caf7b 100644 --- a/src/Domain/Rating/Exceptions/InvalidScore.php +++ b/src/Domain/Rating/Exceptions/InvalidScoreException.php @@ -5,7 +5,7 @@ use Illuminate\Http\JsonResponse; use Support\DomainException; -class InvalidScore extends DomainException +class InvalidScoreException extends DomainException { public function __construct( private readonly int $min, diff --git a/src/Domain/Rating/Factories/RatingFactory.php b/src/Domain/Rating/Factories/RatingFactory.php index ede0836..8ee4bd8 100644 --- a/src/Domain/Rating/Factories/RatingFactory.php +++ b/src/Domain/Rating/Factories/RatingFactory.php @@ -3,7 +3,7 @@ namespace Domain\Rating\Factories; use Domain\Quotes\Models\Quote; -use Domain\Rating\Exceptions\InvalidScore; +use Domain\Rating\Exceptions\InvalidScoreException; use Domain\Users\Models\User; class RatingFactory @@ -27,7 +27,7 @@ public function withQuote(Quote $quote): static } /** - * @throws InvalidScore + * @throws InvalidScoreException */ public function create(int $score): void { diff --git a/src/Domain/Rating/Utils/CanRate.php b/src/Domain/Rating/Utils/CanRate.php index 61a8b6c..394d064 100644 --- a/src/Domain/Rating/Utils/CanRate.php +++ b/src/Domain/Rating/Utils/CanRate.php @@ -4,7 +4,7 @@ use Domain\Quotes\Models\Quote; use Domain\Rating\Events\ModelRated; -use Domain\Rating\Exceptions\InvalidScore; +use Domain\Rating\Exceptions\InvalidScoreException; use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Relations\MorphToMany; @@ -35,14 +35,14 @@ public function ratings(null|string|Model $model = null): MorphToMany /** * @param Quote $model * - * @throws InvalidScore + * @throws InvalidScoreException */ public function rate(Model $model, int|null $score): bool { $min = (int) config('rating.min'); $max = (int) config('rating.max'); if ($score < $min || $score > $max) { - throw new InvalidScore($min, $max); + throw new InvalidScoreException($min, $max); } $this->ratings($model)->attach($model->getKey(), [ diff --git a/src/Services/ExternalApi/ExternalApiService.php b/src/Services/ExternalApi/ExternalApiService.php index c5ff9d8..84dd89c 100644 --- a/src/Services/ExternalApi/ExternalApiService.php +++ b/src/Services/ExternalApi/ExternalApiService.php @@ -11,16 +11,16 @@ use Services\ExternalApi\Data\QuoteData; use Services\ExternalApi\Exceptions\ExternalApiException; -class ExternalApiService +readonly class ExternalApiService { use CanBeFaked; public function __construct( - public readonly string $baseUri, - public readonly string $key, - public readonly int $timeout, - public readonly ?int $retryTimes = null, - public readonly ?int $retrySleep = null, + public string $baseUri, + public string $key, + public int $timeout, + public ?int $retryTimes = null, + public ?int $retrySleep = null, ) { } diff --git a/tests/Unit/Rating/Models/RatingTest.php b/tests/Unit/Rating/Models/RatingTest.php index 47a4b29..46c673d 100644 --- a/tests/Unit/Rating/Models/RatingTest.php +++ b/tests/Unit/Rating/Models/RatingTest.php @@ -48,7 +48,7 @@ $user = User::factory()->create(); $user->rate($this->quote, 100); -})->throws(\Domain\Rating\Exceptions\InvalidScore::class); +})->throws(\Domain\Rating\Exceptions\InvalidScoreException::class); it('cannot rate with invalid min score', function () { config()->set('rating.min', 1); @@ -57,7 +57,7 @@ $user = User::factory()->create(); $user->rate($this->quote, 0); -})->throws(\Domain\Rating\Exceptions\InvalidScore::class); +})->throws(\Domain\Rating\Exceptions\InvalidScoreException::class); it('can rate a model', function () { $this->user->rate($this->quote, 5);