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 }} diff --git a/src/Fixer/Commenting/FixTagTypoFixer.php b/src/Fixer/Commenting/FixTagTypoFixer.php new file mode 100644 index 00000000..e1c04cb8 --- /dev/null +++ b/src/Fixer/Commenting/FixTagTypoFixer.php @@ -0,0 +1,37 @@ + $tokens + */ + protected function processDocContent(string $docContent, Tokens $tokens, int $position): string + { + return Regex::replace($docContent, self::PLURAL_TAG_REGEX, '@$1'); + } +} diff --git a/tests/Fixer/Commenting/FixTagTypoFixer/FixTagTypoFixerTest.php b/tests/Fixer/Commenting/FixTagTypoFixer/FixTagTypoFixerTest.php new file mode 100644 index 00000000..c7729266 --- /dev/null +++ b/tests/Fixer/Commenting/FixTagTypoFixer/FixTagTypoFixerTest.php @@ -0,0 +1,28 @@ +doTestFile($filePath); + } + + public static function provideData(): Iterator + { + return self::yieldFiles(__DIR__ . '/Fixture'); + } + + public function provideConfig(): string + { + return __DIR__ . '/config/configured_rule.php'; + } +} diff --git a/tests/Fixer/Commenting/FixTagTypoFixer/Fixture/plural_tags.php.inc b/tests/Fixer/Commenting/FixTagTypoFixer/Fixture/plural_tags.php.inc new file mode 100644 index 00000000..e056b305 --- /dev/null +++ b/tests/Fixer/Commenting/FixTagTypoFixer/Fixture/plural_tags.php.inc @@ -0,0 +1,25 @@ + +----- + diff --git a/tests/Fixer/Commenting/FixTagTypoFixer/Fixture/skip_correct_tags.php.inc b/tests/Fixer/Commenting/FixTagTypoFixer/Fixture/skip_correct_tags.php.inc new file mode 100644 index 00000000..fb7e4000 --- /dev/null +++ b/tests/Fixer/Commenting/FixTagTypoFixer/Fixture/skip_correct_tags.php.inc @@ -0,0 +1,10 @@ + +----- + diff --git a/tests/Fixer/Commenting/FixTagTypoFixer/config/configured_rule.php b/tests/Fixer/Commenting/FixTagTypoFixer/config/configured_rule.php new file mode 100644 index 00000000..5f07c1ff --- /dev/null +++ b/tests/Fixer/Commenting/FixTagTypoFixer/config/configured_rule.php @@ -0,0 +1,10 @@ +rule(FixTagTypoFixer::class); +};