From 2e44e19c6d89569bd26b420d8cd209b2fbc0baf0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Andr=C3=A9s=20L=C3=B3pez=20G=2E?= Date: Tue, 19 Nov 2024 09:27:42 -0500 Subject: [PATCH 1/5] feat: Upgrades runtime to php 8.3 --- composer.json | 4 ++-- rector.php | 25 +++++++++---------------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 1e32ec3..15e4a03 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,7 @@ } ], "require": { - "php": "^8.2", + "php": "^8.3", "ext-json": "*", "guzzlehttp/guzzle": "^7.7", "psr/log": "^3.0" @@ -33,7 +33,7 @@ "symfony/var-dumper": "^4.2", "friendsofphp/php-cs-fixer": "^3.6", "eduarguz/shift-php-cs": "^3.0", - "rector/rector": "^0.17.0", + "rector/rector": "^1", "fig/log-test": "^1.1", "phpstan/phpstan": "^1.10" }, diff --git a/rector.php b/rector.php index cbb7110..3edb29d 100644 --- a/rector.php +++ b/rector.php @@ -4,24 +4,17 @@ use Rector\Caching\ValueObject\Storage\FileCacheStorage; use Rector\Config\RectorConfig; -use Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector; use Rector\Set\ValueObject\LevelSetList; -return static function (RectorConfig $rectorConfig): void { - $rectorConfig->paths([ +return RectorConfig::configure() + ->withPaths([ __DIR__.'/src', __DIR__.'/tests', - ]); + ]) + ->withRules([ + InlineConstructorDefaultToPropertyRector::class, + ])->withSets([ + LevelSetList::UP_TO_PHP_83, + ]) + ->withCache('./.rector-cache', FileCacheStorage::class); - // define sets of rules - $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_82, - ]); - - $rectorConfig->skip([ - JsonThrowOnErrorRector::class, - ]); - - $rectorConfig->cacheClass(FileCacheStorage::class); - $rectorConfig->cacheDirectory('./.rector-cache'); -}; From 1f03e630f519fcef7345c2a3a80eb77ff1337c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Andr=C3=A9s=20L=C3=B3pez=20G=2E?= Date: Tue, 19 Nov 2024 09:29:07 -0500 Subject: [PATCH 2/5] feat: run composer rector --- rector.php | 2 +- src/LoggerWithSanitizer.php | 1 + tests/Unit/HttpLogMiddlewareTest.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/rector.php b/rector.php index 3edb29d..cdffadd 100644 --- a/rector.php +++ b/rector.php @@ -3,6 +3,7 @@ declare(strict_types=1); use Rector\Caching\ValueObject\Storage\FileCacheStorage; +use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector; use Rector\Config\RectorConfig; use Rector\Set\ValueObject\LevelSetList; @@ -17,4 +18,3 @@ LevelSetList::UP_TO_PHP_83, ]) ->withCache('./.rector-cache', FileCacheStorage::class); - diff --git a/src/LoggerWithSanitizer.php b/src/LoggerWithSanitizer.php index 96367c5..86c10a1 100644 --- a/src/LoggerWithSanitizer.php +++ b/src/LoggerWithSanitizer.php @@ -13,6 +13,7 @@ public function __construct(private readonly LoggerInterface $logger, private re // } + #[\Override] public function log($level, \Stringable|string $message, array $context = []): void { if (! empty($this->fieldsToSanitize)) { diff --git a/tests/Unit/HttpLogMiddlewareTest.php b/tests/Unit/HttpLogMiddlewareTest.php index b4ee30c..5a18ca0 100644 --- a/tests/Unit/HttpLogMiddlewareTest.php +++ b/tests/Unit/HttpLogMiddlewareTest.php @@ -22,6 +22,7 @@ class HttpLogMiddlewareTest extends TestCase private TestLogger $logger; + #[\Override] public function setUp(): void { parent::setUp(); From 7fc704707957cabc9607d913ff2fab5f5b510e37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Andr=C3=A9s=20L=C3=B3pez=20G=2E?= Date: Tue, 19 Nov 2024 09:31:31 -0500 Subject: [PATCH 3/5] Update CHANGELOG.md --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a1a10eb..8f68e2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.0] - 2024-11-19 + +### Changed +- Upgrades runtime to php 8.3 + ## [1.0.1] - 2024-03-26 ### Changed From 8d3e694a36570fc3de730b1bea2a5404b80914e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Andr=C3=A9s=20L=C3=B3pez=20G=2E?= Date: Tue, 19 Nov 2024 09:34:08 -0500 Subject: [PATCH 4/5] Update guzzle-logger-check.yml --- .github/workflows/guzzle-logger-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/guzzle-logger-check.yml b/.github/workflows/guzzle-logger-check.yml index f08b4ba..75251d3 100644 --- a/.github/workflows/guzzle-logger-check.yml +++ b/.github/workflows/guzzle-logger-check.yml @@ -28,7 +28,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@2.25.1 with: - php-version: 8.2 + php-version: '8.3' - name: 🛠️Install dependencies run: composer install --no-interaction --prefer-dist --no-progress @@ -48,7 +48,7 @@ jobs: - name: Setup PHP with Xdebug uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' coverage: xdebug - name: 🧪Run test suite From 24d1e7a3391c66290cf37a7532f2555f9b6de69d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Andr=C3=A9s=20L=C3=B3pez=20G=2E?= Date: Tue, 19 Nov 2024 11:41:22 -0500 Subject: [PATCH 5/5] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f68e2f..12d5342 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.1.0] - 2024-11-19 +## [2.0.0] - 2024-11-19 ### Changed - Upgrades runtime to php 8.3