From 3ebdb66b2e215fa8a76bbfb685f9cd90bd0a4172 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 25 Jun 2026 11:40:01 +0200 Subject: [PATCH 1/3] README: mark package deprecated, point to ECS --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index e3a83490..2a6368e2 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ [![Downloads](https://img.shields.io/packagist/dt/symplify/coding-standard.svg?style=flat-square)](https://packagist.org/packages/symplify/coding-standard/stats) +> [!WARNING] +> **This package is deprecated.** Use [Easy Coding Standard (ECS)](https://github.com/easy-coding-standard/easy-coding-standard) instead, where these rules and coding standard work out of the box—no extra setup needed. + Coding standard rules for clean, consistent, and readable PHP code. No configuration needed—just install and let it handle the rest. They run best with [ECS](https://github.com/symplify/easy-coding-standard). From 3ff008e56e64b3de191dedf8c992b28a789d6916 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Thu, 25 Jun 2026 11:42:29 +0200 Subject: [PATCH 2/3] CI: drop vendor coding-standard symlink override, path no longer exists --- .github/workflows/code_analysis.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/code_analysis.yaml b/.github/workflows/code_analysis.yaml index e536767d..c8b1b08a 100644 --- a/.github/workflows/code_analysis.yaml +++ b/.github/workflows/code_analysis.yaml @@ -55,9 +55,4 @@ jobs: # composer install cache - https://github.com/ramsey/composer-install - uses: "ramsey/composer-install@v3" - # Override code from symplify/coding-standard shipped with ECS - - run: | - rm -rf vendor/symplify/easy-coding-standard/vendor/symplify/coding-standard/src - ln -s $PWD/src vendor/symplify/easy-coding-standard/vendor/symplify/coding-standard/ - - run: ${{ matrix.actions.run }} From 93c149e5d9618e7a90b864486a6bbde8cce49803 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Sun, 12 Jul 2026 20:26:12 +0200 Subject: [PATCH 3/3] Match method-name docblock descriptions with articles and punctuation --- ...oveMethodNameDuplicateDescriptionFixer.php | 19 +++++++++-- .../Fixture/with_articles.php.inc | 34 +++++++++++++++++++ 2 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 tests/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer/Fixture/with_articles.php.inc diff --git a/src/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer.php b/src/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer.php index 3fcc29e0..6ece9c59 100644 --- a/src/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer.php +++ b/src/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer.php @@ -70,8 +70,7 @@ public function fix(SplFileInfo $fileInfo, Tokens $tokens): void $docblockLines = explode("\n", $originalDocContent); foreach ($docblockLines as $key => $docblockLine) { - $spacelessDocblockLine = Regex::replace($docblockLine, '#[\s\n]+#', ''); - if (strtolower($spacelessDocblockLine) !== strtolower('*' . $methodName)) { + if (! $this->isMethodNameDescriptionLine($docblockLine, $methodName)) { continue; } @@ -86,4 +85,20 @@ public function fix(SplFileInfo $fileInfo, Tokens $tokens): void $tokens[$index] = new Token([T_DOC_COMMENT, implode("\n", $docblockLines)]); } } + + private function isMethodNameDescriptionLine(string $docblockLine, string $methodName): bool + { + $normalizedLine = strtolower(ltrim(trim($docblockLine), '*')); + + // drop articles, so "Get the API helper" still matches getApiHelper() + $words = array_filter( + explode(' ', $normalizedLine), + static fn (string $word): bool => ! in_array(trim($word, '.,!:;'), ['a', 'an', 'the'], true) + ); + + // strip whitespace and trailing punctuation + $spacelessLine = Regex::replace(implode(' ', $words), '#[^a-z0-9]+#', ''); + + return $spacelessLine === strtolower($methodName); + } } diff --git a/tests/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer/Fixture/with_articles.php.inc b/tests/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer/Fixture/with_articles.php.inc new file mode 100644 index 00000000..8ad42dda --- /dev/null +++ b/tests/Fixer/Annotation/RemoveMethodNameDuplicateDescriptionFixer/Fixture/with_articles.php.inc @@ -0,0 +1,34 @@ + +----- +