From 4ebeb9ab71eedaf72a67d9b0f3610eaf9e81066b Mon Sep 17 00:00:00 2001 From: turegjorup Date: Sun, 8 Nov 2026 21:32:53 +0100 Subject: [PATCH 1/2] chore: update Rector and PHPStan and apply new Rector rules Rector 2.8 adds ParamAndEnvAttributeRector and DirnameDirConcatStringToDirectStringPathRector. Both changes are equivalent code. The PHPStan baseline does not change. --- CHANGELOG.md | 2 + composer.lock | 66 +++++++++++++++---------------- src/Command/ApiKeysAddCommand.php | 2 +- tests/bootstrap.php | 4 +- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 57c7f78..7131228 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ See [keep a changelog] for information about writing changes to this log. ## [Unreleased] +- [PR-XX](https://github.com/itk-dev/event-database-api/pull/XX) + Update Rector (2.8) and PHPStan (2.3) and apply the new Rector rules - [PR-74](https://github.com/itk-dev/event-database-api/pull/74) Update dependencies in-constraint (Symfony 7.4.23 security release, API Platform 4.3.21, PHPUnit 13.4) - [PR-73](https://github.com/itk-dev/event-database-api/pull/73) diff --git a/composer.lock b/composer.lock index ef6ad18..f9b290f 100644 --- a/composer.lock +++ b/composer.lock @@ -8120,11 +8120,11 @@ }, { "name": "phpstan/phpstan", - "version": "2.2.5", + "version": "2.3.4", "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/909c1e5fef7989ac0d0c1c5c42e32a5c4f6198a0", - "reference": "909c1e5fef7989ac0d0c1c5c42e32a5c4f6198a0", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/f20ce6f3c82556cfcfc086b152445a12d1d64fff", + "reference": "f20ce6f3c82556cfcfc086b152445a12d1d64fff", "shasum": "" }, "require": { @@ -8180,32 +8180,33 @@ "type": "github" } ], - "time": "2026-07-05T06:31:06+00:00", - "published-time": "2026-07-05T06:31:19+00:00" + "time": "2026-10-28T22:38:53+00:00", + "published-time": "2026-10-28T22:39:06+00:00" }, { "name": "phpstan/phpstan-strict-rules", - "version": "2.0.11", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-strict-rules.git", - "reference": "9b000a578b85b32945b358b172c7b20e91189024" + "reference": "24ec51589f896f048d0d36de373d993b5cf71786" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/9b000a578b85b32945b358b172c7b20e91189024", - "reference": "9b000a578b85b32945b358b172c7b20e91189024", + "url": "https://api.github.com/repos/phpstan/phpstan-strict-rules/zipball/24ec51589f896f048d0d36de373d993b5cf71786", + "reference": "24ec51589f896f048d0d36de373d993b5cf71786", "shasum": "" }, "require": { "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.39" + "phpstan/phpstan": "^2.3" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/phpstan-deprecation-rules": "^2.0", "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^9.6" + "phpunit/phpunit": "^9.6", + "shipmonk/name-collision-detector": "^2.1" }, "type": "phpstan-extension", "extra": { @@ -8230,36 +8231,36 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan-strict-rules/issues", - "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.0.11" + "source": "https://github.com/phpstan/phpstan-strict-rules/tree/2.1.0" }, - "time": "2026-05-02T06:54:10+00:00", - "published-time": "2026-05-02T06:54:56+00:00" + "time": "2026-10-01T21:30:37+00:00", + "published-time": "2026-10-06T07:32:29+00:00" }, { "name": "phpstan/phpstan-symfony", - "version": "2.0.20", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan-symfony.git", - "reference": "53f1a6462dbe71fad36ce054caf5e1b725b740fd" + "reference": "e218a49b5d24c9fd74903e22433fb10e16c33a53" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/53f1a6462dbe71fad36ce054caf5e1b725b740fd", - "reference": "53f1a6462dbe71fad36ce054caf5e1b725b740fd", + "url": "https://api.github.com/repos/phpstan/phpstan-symfony/zipball/e218a49b5d24c9fd74903e22433fb10e16c33a53", + "reference": "e218a49b5d24c9fd74903e22433fb10e16c33a53", "shasum": "" }, "require": { "ext-simplexml": "*", "php": "^7.4 || ^8.0", - "phpstan/phpstan": "^2.1.13" + "phpstan/phpstan": "^2.3" }, "conflict": { "symfony/framework-bundle": "<3.0" }, "require-dev": { "php-parallel-lint/php-parallel-lint": "^1.2", - "phpstan/phpstan-phpunit": "^2.0.8", + "phpstan/phpstan-phpunit": "^2.0.13", "phpstan/phpstan-strict-rules": "^2.0", "phpunit/phpunit": "^9.6", "psr/container": "1.1.2", @@ -8305,10 +8306,10 @@ ], "support": { "issues": "https://github.com/phpstan/phpstan-symfony/issues", - "source": "https://github.com/phpstan/phpstan-symfony/tree/2.0.20" + "source": "https://github.com/phpstan/phpstan-symfony/tree/2.1.1" }, - "time": "2026-06-16T09:17:35+00:00", - "published-time": "2026-06-16T09:25:10+00:00" + "time": "2026-10-25T14:57:26+00:00", + "published-time": "2026-10-26T09:30:48+00:00" }, { "name": "phpunit/php-code-coverage", @@ -9325,21 +9326,21 @@ }, { "name": "rector/rector", - "version": "2.5.4", + "version": "2.8.3", "source": { "type": "git", "url": "https://github.com/rectorphp/rector.git", - "reference": "adaa18d7cd6b3c960967cfbc98c03efb3116ac0e" + "reference": "12ddb68d34acb91bcf3d00302bf1c7c1b5840bd6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/rectorphp/rector/zipball/adaa18d7cd6b3c960967cfbc98c03efb3116ac0e", - "reference": "adaa18d7cd6b3c960967cfbc98c03efb3116ac0e", + "url": "https://api.github.com/repos/rectorphp/rector/zipball/12ddb68d34acb91bcf3d00302bf1c7c1b5840bd6", + "reference": "12ddb68d34acb91bcf3d00302bf1c7c1b5840bd6", "shasum": "" }, "require": { "php": "^7.4|^8.0", - "phpstan/phpstan": "^2.2.2" + "phpstan/phpstan": "^2.3.4" }, "conflict": { "rector/rector-doctrine": "*", @@ -9347,9 +9348,6 @@ "rector/rector-phpunit": "*", "rector/rector-symfony": "*" }, - "suggest": { - "ext-dom": "To manipulate phpunit.xml via the custom-rule command" - }, "bin": [ "bin/rector" ], @@ -9373,7 +9371,7 @@ ], "support": { "issues": "https://github.com/rectorphp/rector/issues", - "source": "https://github.com/rectorphp/rector/tree/2.5.4" + "source": "https://github.com/rectorphp/rector/tree/2.8.3" }, "funding": [ { @@ -9381,8 +9379,8 @@ "type": "github" } ], - "time": "2026-07-06T12:41:46+00:00", - "published-time": "2026-07-06T12:41:52+00:00" + "time": "2026-10-29T05:51:41+00:00", + "published-time": "2026-10-29T05:51:47+00:00" }, { "name": "sebastian/cli-parser", diff --git a/src/Command/ApiKeysAddCommand.php b/src/Command/ApiKeysAddCommand.php index 4104de0..6cc0c7b 100644 --- a/src/Command/ApiKeysAddCommand.php +++ b/src/Command/ApiKeysAddCommand.php @@ -28,7 +28,7 @@ class ApiKeysAddCommand extends Command private const string ENV_LINE_PATTERN = '/^APP_API_KEYS=(?:\'[^\']*\'|"(?:[^"\\\\]|\\\\.)*"|.*)$/m'; public function __construct( - #[Autowire('%kernel.project_dir%')] + #[Autowire(param: 'kernel.project_dir')] private readonly string $projectDir, ) { parent::__construct(); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index bc44ee1..9d37f70 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -4,10 +4,10 @@ use Symfony\Component\Dotenv\Dotenv; -require dirname(__DIR__).'/vendor/autoload.php'; +require __DIR__.'/../vendor/autoload.php'; if (method_exists(Dotenv::class, 'bootEnv')) { - new Dotenv()->bootEnv(dirname(__DIR__).'/.env'); + new Dotenv()->bootEnv(__DIR__.'/../.env'); } if ($_SERVER['APP_DEBUG']) { From 9411d3de1a9859daf1c25db97388e391732fde34 Mon Sep 17 00:00:00 2001 From: turegjorup Date: Sun, 8 Nov 2026 21:33:20 +0100 Subject: [PATCH 2/2] docs: set PR number in CHANGELOG entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7131228..ab21e58 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ See [keep a changelog] for information about writing changes to this log. ## [Unreleased] -- [PR-XX](https://github.com/itk-dev/event-database-api/pull/XX) +- [PR-75](https://github.com/itk-dev/event-database-api/pull/75) Update Rector (2.8) and PHPStan (2.3) and apply the new Rector rules - [PR-74](https://github.com/itk-dev/event-database-api/pull/74) Update dependencies in-constraint (Symfony 7.4.23 security release, API Platform 4.3.21, PHPUnit 13.4)