From 9a70a2629c0151f8db80dbaaeaf2fa523eb3893d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Tvrd=C3=ADk?= Date: Mon, 16 Jun 2025 16:34:28 +0200 Subject: [PATCH 1/2] Replace slevomat/coding-standard with shipmonk/coding-standard MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove slevomat/coding-standard dependency - Add shipmonk/coding-standard dependency - Update phpcs.xml.dist to use ShipMonkCodingStandard ruleset - Preserve existing file paths and cache configuration 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- composer-dependency-analyser.php | 2 +- composer.json | 4 +- composer.lock | 120 ++++++--- phpcs.xml.dist | 401 +------------------------------ 4 files changed, 92 insertions(+), 435 deletions(-) diff --git a/composer-dependency-analyser.php b/composer-dependency-analyser.php index a409741..c47ec92 100644 --- a/composer-dependency-analyser.php +++ b/composer-dependency-analyser.php @@ -11,10 +11,10 @@ 'phpstan/phpstan', 'phpstan/phpstan-phpunit', 'phpstan/phpstan-strict-rules', + 'shipmonk/coding-standard', 'shipmonk/composer-dependency-analyser', 'shipmonk/dead-code-detector', 'shipmonk/phpstan-rules', - 'slevomat/coding-standard', ]; return $config diff --git a/composer.json b/composer.json index 3b57ed9..d9d9973 100644 --- a/composer.json +++ b/composer.json @@ -19,10 +19,10 @@ "phpstan/phpstan-phpunit": "^2.0.6", "phpstan/phpstan-strict-rules": "^2.0.4", "phpunit/phpunit": "^10.5.46", + "shipmonk/coding-standard": "^0.1.3", "shipmonk/composer-dependency-analyser": "^1.8.3", "shipmonk/dead-code-detector": "^0.12.1", - "shipmonk/phpstan-rules": "^4.1.3", - "slevomat/coding-standard": "^8.15.0" + "shipmonk/phpstan-rules": "^4.1.3" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 6a791c6..4d38205 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": "30794331de40d41d9692486723492827", + "content-hash": "7f271d2e4a7ecd83ce42be1e40971afa", "packages": [ { "name": "doctrine/cache", @@ -2882,30 +2882,30 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.33.0", + "version": "2.1.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" + "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", - "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", + "reference": "9b30d6fd026b2c132b3985ce6b23bec09ab3aa68", "shasum": "" }, "require": { - "php": "^7.2 || ^8.0" + "php": "^7.4 || ^8.0" }, "require-dev": { "doctrine/annotations": "^2.0", - "nikic/php-parser": "^4.15", + "nikic/php-parser": "^5.3.0", "php-parallel-lint/php-parallel-lint": "^1.2", "phpstan/extension-installer": "^1.0", - "phpstan/phpstan": "^1.5", - "phpstan/phpstan-phpunit": "^1.1", - "phpstan/phpstan-strict-rules": "^1.0", - "phpunit/phpunit": "^9.5", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", "symfony/process": "^5.2" }, "type": "library", @@ -2923,9 +2923,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.1.0" }, - "time": "2024-10-13T11:25:22+00:00" + "time": "2025-02-19T13:28:12+00:00" }, { "name": "phpstan/phpstan", @@ -4432,6 +4432,54 @@ ], "time": "2023-02-07T11:34:05+00:00" }, + { + "name": "shipmonk/coding-standard", + "version": "0.1.3", + "source": { + "type": "git", + "url": "https://github.com/shipmonk-rnd/coding-standard.git", + "reference": "72ebaaf06383f4bf5189a8076f05343d634ba943" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/shipmonk-rnd/coding-standard/zipball/72ebaaf06383f4bf5189a8076f05343d634ba943", + "reference": "72ebaaf06383f4bf5189a8076f05343d634ba943", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "slevomat/coding-standard": "^8.19.1" + }, + "require-dev": { + "editorconfig-checker/editorconfig-checker": "^10.6", + "ergebnis/composer-normalize": "^2.45", + "ext-simplexml": "*", + "phpstan/phpstan": "^2.1", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", + "shipmonk/composer-dependency-analyser": "^1.8", + "shipmonk/dead-code-detector": "^0.12", + "shipmonk/name-collision-detector": "^2.1", + "shipmonk/phpstan-rules": "^4.1" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "ShipMonk\\CodingStandard\\": "ShipMonkCodingStandard/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHP Coding Standard used in ShipMonk", + "support": { + "issues": "https://github.com/shipmonk-rnd/coding-standard/issues", + "source": "https://github.com/shipmonk-rnd/coding-standard/tree/0.1.3" + }, + "time": "2025-06-16T11:43:35+00:00" + }, { "name": "shipmonk/composer-dependency-analyser", "version": "1.8.3", @@ -4633,32 +4681,32 @@ }, { "name": "slevomat/coding-standard", - "version": "8.15.0", + "version": "8.19.1", "source": { "type": "git", "url": "https://github.com/slevomat/coding-standard.git", - "reference": "7d1d957421618a3803b593ec31ace470177d7817" + "reference": "458d665acd49009efebd7e0cb385d71ae9ac3220" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/7d1d957421618a3803b593ec31ace470177d7817", - "reference": "7d1d957421618a3803b593ec31ace470177d7817", + "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/458d665acd49009efebd7e0cb385d71ae9ac3220", + "reference": "458d665acd49009efebd7e0cb385d71ae9ac3220", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.6.2 || ^0.7 || ^1.0", - "php": "^7.2 || ^8.0", - "phpstan/phpdoc-parser": "^1.23.1", - "squizlabs/php_codesniffer": "^3.9.0" + "php": "^7.4 || ^8.0", + "phpstan/phpdoc-parser": "^2.1.0", + "squizlabs/php_codesniffer": "^3.13.0" }, "require-dev": { - "phing/phing": "2.17.4", - "php-parallel-lint/php-parallel-lint": "1.3.2", - "phpstan/phpstan": "1.10.60", - "phpstan/phpstan-deprecation-rules": "1.1.4", - "phpstan/phpstan-phpunit": "1.3.16", - "phpstan/phpstan-strict-rules": "1.5.2", - "phpunit/phpunit": "8.5.21|9.6.8|10.5.11" + "phing/phing": "3.0.1", + "php-parallel-lint/php-parallel-lint": "1.4.0", + "phpstan/phpstan": "2.1.17", + "phpstan/phpstan-deprecation-rules": "2.0.3", + "phpstan/phpstan-phpunit": "2.0.6", + "phpstan/phpstan-strict-rules": "2.0.4", + "phpunit/phpunit": "9.6.8|10.5.45|11.4.4|11.5.21|12.1.3" }, "type": "phpcodesniffer-standard", "extra": { @@ -4682,7 +4730,7 @@ ], "support": { "issues": "https://github.com/slevomat/coding-standard/issues", - "source": "https://github.com/slevomat/coding-standard/tree/8.15.0" + "source": "https://github.com/slevomat/coding-standard/tree/8.19.1" }, "funding": [ { @@ -4694,20 +4742,20 @@ "type": "tidelift" } ], - "time": "2024-03-09T15:20:58+00:00" + "time": "2025-06-09T17:53:57+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.9.2", + "version": "3.13.1", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480" + "reference": "1b71b4dd7e7ef651ac749cea67e513c0c832f4bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/aac1f6f347a5c5ac6bc98ad395007df00990f480", - "reference": "aac1f6f347a5c5ac6bc98ad395007df00990f480", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1b71b4dd7e7ef651ac749cea67e513c0c832f4bd", + "reference": "1b71b4dd7e7ef651ac749cea67e513c0c832f4bd", "shasum": "" }, "require": { @@ -4772,9 +4820,13 @@ { "url": "https://opencollective.com/php_codesniffer", "type": "open_collective" + }, + { + "url": "https://thanks.dev/u/gh/phpcsstandards", + "type": "thanks_dev" } ], - "time": "2024-04-23T20:25:34+00:00" + "time": "2025-06-12T15:04:34+00:00" }, { "name": "theseer/tokenizer", diff --git a/phpcs.xml.dist b/phpcs.xml.dist index 31534e4..92baccb 100644 --- a/phpcs.xml.dist +++ b/phpcs.xml.dist @@ -2,408 +2,13 @@ - - - - - - - - src/ tests/ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Exception type missing for @throws annotation - - - Only 1 @return annotation is allowed in a function comment - - - Extra @param annotation - - - @param annotation for parameter "%s" missing - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + \ No newline at end of file From e596e6442e0ff17633642ec819b2cbc46a82bcd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Tvrd=C3=ADk?= Date: Mon, 16 Jun 2025 16:35:31 +0200 Subject: [PATCH 2/2] Apply coding standard fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed 8 coding standard violations across 5 files using composer fix:cs. All files now pass composer check:cs validation. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- src/Doctrine/MySql/IndexHint.php | 25 ++++++++++++++++--- src/Doctrine/MySql/UseIndexHintHandler.php | 5 +++- tests/Doctrine/MySql/Account.php | 5 +++- .../Doctrine/MySql/UseIndexSqlWalkerTest.php | 7 +++++- tests/Doctrine/MySql/User.php | 5 +++- 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/src/Doctrine/MySql/IndexHint.php b/src/Doctrine/MySql/IndexHint.php index 24d774c..7e5d526 100644 --- a/src/Doctrine/MySql/IndexHint.php +++ b/src/Doctrine/MySql/IndexHint.php @@ -13,7 +13,12 @@ class IndexHint private ?string $dqlAlias; - private function __construct(string $type, string $indexName, string $tableName, ?string $dqlAlias) + private function __construct( + string $type, + string $indexName, + string $tableName, + ?string $dqlAlias, + ) { $this->type = $type; $this->indexName = $indexName; @@ -21,17 +26,29 @@ private function __construct(string $type, string $indexName, string $tableName, $this->dqlAlias = $dqlAlias; } - public static function use(string $indexName, string $tableName, ?string $dqlAlias = null): self + public static function use( + string $indexName, + string $tableName, + ?string $dqlAlias = null, + ): self { return new self('USE', $indexName, $tableName, $dqlAlias); } - public static function force(string $indexName, string $tableName, ?string $dqlAlias = null): self + public static function force( + string $indexName, + string $tableName, + ?string $dqlAlias = null, + ): self { return new self('FORCE', $indexName, $tableName, $dqlAlias); } - public static function ignore(string $indexName, string $tableName, ?string $dqlAlias = null): self + public static function ignore( + string $indexName, + string $tableName, + ?string $dqlAlias = null, + ): self { return new self('IGNORE', $indexName, $tableName, $dqlAlias); } diff --git a/src/Doctrine/MySql/UseIndexHintHandler.php b/src/Doctrine/MySql/UseIndexHintHandler.php index d8ffc03..e75eb39 100644 --- a/src/Doctrine/MySql/UseIndexHintHandler.php +++ b/src/Doctrine/MySql/UseIndexHintHandler.php @@ -29,7 +29,10 @@ public function getNodes(): array return [SqlNode::SelectStatement, SqlNode::UpdateStatement, SqlNode::DeleteStatement]; } - public function processNode(SqlNode $sqlNode, string $sql): string + public function processNode( + SqlNode $sqlNode, + string $sql, + ): string { $selfClass = static::class; $sqlWalker = $this->getDoctrineSqlWalker(); diff --git a/tests/Doctrine/MySql/Account.php b/tests/Doctrine/MySql/Account.php index af247a6..00a991d 100644 --- a/tests/Doctrine/MySql/Account.php +++ b/tests/Doctrine/MySql/Account.php @@ -26,7 +26,10 @@ class Account #[JoinColumn(nullable: false)] public User $manager; - public function __construct(int $id, User $manager) + public function __construct( + int $id, + User $manager, + ) { $this->id = $id; $this->manager = $manager; diff --git a/tests/Doctrine/MySql/UseIndexSqlWalkerTest.php b/tests/Doctrine/MySql/UseIndexSqlWalkerTest.php index 870563a..81910fd 100644 --- a/tests/Doctrine/MySql/UseIndexSqlWalkerTest.php +++ b/tests/Doctrine/MySql/UseIndexSqlWalkerTest.php @@ -23,7 +23,12 @@ class UseIndexSqlWalkerTest extends TestCase * @param callable(Query): void $configureQueryCallback */ #[DataProvider('walksProvider')] - public function testWalker(string $dql, callable $configureQueryCallback, ?string $expectedSql, ?string $expectedError = null): void + public function testWalker( + string $dql, + callable $configureQueryCallback, + ?string $expectedSql, + ?string $expectedError = null, + ): void { if ($expectedError !== null) { $this->expectException(LogicException::class); diff --git a/tests/Doctrine/MySql/User.php b/tests/Doctrine/MySql/User.php index 722f8db..6138b77 100644 --- a/tests/Doctrine/MySql/User.php +++ b/tests/Doctrine/MySql/User.php @@ -35,7 +35,10 @@ class User #[OneToMany(targetEntity: Account::class, mappedBy: 'manager')] public Collection $managedAccounts; - public function __construct(int $id, Account $account) + public function __construct( + int $id, + Account $account, + ) { $this->id = $id; $this->account = $account;