Skip to content

Commit

Permalink
Fix: Remove RuleSet\AbstractRuleSet::DOCTRINE_IGNORED_TAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Sep 17, 2023
1 parent 111cebb commit bab9a8d
Show file tree
Hide file tree
Showing 28 changed files with 218 additions and 296 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ For a full diff see [`5.15.1...main`][5.15.1...main].
- Removed `$targetPhpVersion` field and `targetPhpVersion()` method from `Config\Ruleset\AbstractRuleSet` ([#866]), by [@localheinz]
- Removed `name()` method from `Config\Ruleset\AbstractRuleSet` ([#867]), by [@localheinz]
- Removed `rules()` method from `Config\Ruleset\AbstractRuleSet` ([#868]), by [@localheinz]
- Removed `DOCTRINE_IGNORED_TAGS` constant from `Config\Ruleset\AbstractRuleSet` ([#875]), by [@localheinz]

## [`5.15.1`][5.15.1]

Expand Down Expand Up @@ -1172,6 +1173,7 @@ For a full diff see [`d899e77...1.0.0`][d899e77...1.0.0].
[#871]: https://github.com/ergebnis/php-cs-fixer-config/pull/871
[#872]: https://github.com/ergebnis/php-cs-fixer-config/pull/872
[#874]: https://github.com/ergebnis/php-cs-fixer-config/pull/874
[#875]: https://github.com/ergebnis/php-cs-fixer-config/pull/875

[@dependabot]: https://github.com/apps/dependabot
[@linuxjuggler]: https://github.com/linuxjuggler
Expand Down
100 changes: 0 additions & 100 deletions src/RuleSet/AbstractRuleSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,106 +17,6 @@

abstract class AbstractRuleSet implements RuleSet
{
/**
* A list of tags that should be ignored by fixers related to Doctrine.
*
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.1.0/doc/rules/doctrine_annotation/doctrine_annotation_array_assignment.rst
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.1.0/doc/rules/doctrine_annotation/doctrine_annotation_braces.rst
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.1.0/doc/rules/doctrine_annotation/doctrine_annotation_indentation.rst
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.1.0/doc/rules/doctrine_annotation/doctrine_annotation_spaces.rst
*/
protected const DOCTRINE_IGNORED_TAGS = [
'abstract',
'access',
'after',
'afterClass',
'api',
'author',
'backupGlobals',
'backupStaticAttributes',
'before',
'beforeClass',
'category',
'code',
'codeCoverageIgnore',
'codeCoverageIgnoreEnd',
'codeCoverageIgnoreStart',
'copyright',
'covers',
'coversDefaultClass',
'coversNothing',
'dataProvider',
'depends',
'deprec',
'deprecated',
'encode',
'enduml',
'example',
'exception',
'expectedException',
'expectedExceptionCode',
'expectedExceptionMessage',
'expectedExceptionMessageRegExp',
'filesource',
'final',
'fix',
'FIXME',
'fixme',
'global',
'group',
'ignore',
'ingroup',
'inheritdoc',
'inheritDoc',
'internal',
'large',
'license',
'link',
'magic',
'medium',
'method',
'name',
'noinspection',
'override',
'package',
'package_version',
'param',
'preserveGlobalState',
'private',
'property',
'property-read',
'property-write',
'requires',
'return',
'runInSeparateProcess',
'runTestsInSeparateProcesses',
'see',
'since',
'small',
'source',
'startuml',
'static',
'staticvar',
'staticVar',
'subpackage',
'SuppressWarnings',
'template',
'test',
'testdox',
'throw',
'throws',
'ticket',
'toc',
'todo',
'TODO',
'tutorial',
'usedBy',
'uses',
'uses',
'var',
'version',
];

/**
* @var array<string, array<string, mixed>|bool>
*/
Expand Down
120 changes: 120 additions & 0 deletions src/RuleSet/Doctrine.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
<?php

declare(strict_types=1);

/**
* Copyright (c) 2019-2023 Andreas Möller
*
* For the full copyright and license information, please view
* the LICENSE.md file that was distributed with this source code.
*
* @see https://github.com/ergebnis/php-cs-fixer-config
*/

namespace Ergebnis\PhpCsFixer\Config\RuleSet;

/**
* @internal
*/
final class Doctrine
{
/**
* A list of tags that should be ignored by fixers related to Doctrine.
*
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.1.0/doc/rules/doctrine_annotation/doctrine_annotation_array_assignment.rst
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.1.0/doc/rules/doctrine_annotation/doctrine_annotation_braces.rst
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.1.0/doc/rules/doctrine_annotation/doctrine_annotation_indentation.rst
* @see https://github.com/FriendsOfPHP/PHP-CS-Fixer/blob/v3.1.0/doc/rules/doctrine_annotation/doctrine_annotation_spaces.rst
*/
public const IGNORED_TAGS = [
'abstract',
'access',
'after',
'afterClass',
'api',
'author',
'backupGlobals',
'backupStaticAttributes',
'before',
'beforeClass',
'category',
'code',
'codeCoverageIgnore',
'codeCoverageIgnoreEnd',
'codeCoverageIgnoreStart',
'copyright',
'covers',
'coversDefaultClass',
'coversNothing',
'dataProvider',
'depends',
'deprec',
'deprecated',
'encode',
'enduml',
'example',
'exception',
'expectedException',
'expectedExceptionCode',
'expectedExceptionMessage',
'expectedExceptionMessageRegExp',
'filesource',
'final',
'fix',
'FIXME',
'fixme',
'global',
'group',
'ignore',
'ingroup',
'inheritdoc',
'inheritDoc',
'internal',
'large',
'license',
'link',
'magic',
'medium',
'method',
'name',
'noinspection',
'override',
'package',
'package_version',
'param',
'preserveGlobalState',
'private',
'property',
'property-read',
'property-write',
'requires',
'return',
'runInSeparateProcess',
'runTestsInSeparateProcesses',
'see',
'since',
'small',
'source',
'startuml',
'static',
'staticvar',
'staticVar',
'subpackage',
'SuppressWarnings',
'template',
'test',
'testdox',
'throw',
'throws',
'ticket',
'toc',
'todo',
'TODO',
'tutorial',
'usedBy',
'uses',
'uses',
'var',
'version',
];
}
8 changes: 4 additions & 4 deletions src/RuleSet/Php53.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ final class Php53 extends AbstractRuleSet implements ExplicitRuleSet
'declare_strict_types' => true,
'dir_constant' => true,
'doctrine_annotation_array_assignment' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'operator' => ':',
],
'doctrine_annotation_braces' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'syntax' => 'without_braces',
],
'doctrine_annotation_indentation' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'indent_mixed_lines' => false,
],
'doctrine_annotation_spaces' => [
Expand All @@ -140,7 +140,7 @@ final class Php53 extends AbstractRuleSet implements ExplicitRuleSet
'before_argument_assignments' => false,
'before_array_assignments_colon' => false,
'before_array_assignments_equals' => false,
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
],
'echo_tag_syntax' => [
'format' => 'long',
Expand Down
8 changes: 4 additions & 4 deletions src/RuleSet/Php54.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ final class Php54 extends AbstractRuleSet implements ExplicitRuleSet
'declare_strict_types' => true,
'dir_constant' => true,
'doctrine_annotation_array_assignment' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'operator' => ':',
],
'doctrine_annotation_braces' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'syntax' => 'without_braces',
],
'doctrine_annotation_indentation' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'indent_mixed_lines' => false,
],
'doctrine_annotation_spaces' => [
Expand All @@ -141,7 +141,7 @@ final class Php54 extends AbstractRuleSet implements ExplicitRuleSet
'before_argument_assignments' => false,
'before_array_assignments_colon' => false,
'before_array_assignments_equals' => false,
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
],
'echo_tag_syntax' => [
'format' => 'long',
Expand Down
8 changes: 4 additions & 4 deletions src/RuleSet/Php55.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ final class Php55 extends AbstractRuleSet implements ExplicitRuleSet
'declare_strict_types' => true,
'dir_constant' => true,
'doctrine_annotation_array_assignment' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'operator' => ':',
],
'doctrine_annotation_braces' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'syntax' => 'without_braces',
],
'doctrine_annotation_indentation' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'indent_mixed_lines' => false,
],
'doctrine_annotation_spaces' => [
Expand All @@ -143,7 +143,7 @@ final class Php55 extends AbstractRuleSet implements ExplicitRuleSet
'before_argument_assignments' => false,
'before_array_assignments_colon' => false,
'before_array_assignments_equals' => false,
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
],
'echo_tag_syntax' => [
'format' => 'long',
Expand Down
8 changes: 4 additions & 4 deletions src/RuleSet/Php56.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ final class Php56 extends AbstractRuleSet implements ExplicitRuleSet
'declare_strict_types' => true,
'dir_constant' => true,
'doctrine_annotation_array_assignment' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'operator' => ':',
],
'doctrine_annotation_braces' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'syntax' => 'without_braces',
],
'doctrine_annotation_indentation' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'indent_mixed_lines' => false,
],
'doctrine_annotation_spaces' => [
Expand All @@ -143,7 +143,7 @@ final class Php56 extends AbstractRuleSet implements ExplicitRuleSet
'before_argument_assignments' => false,
'before_array_assignments_colon' => false,
'before_array_assignments_equals' => false,
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
],
'echo_tag_syntax' => [
'format' => 'long',
Expand Down
8 changes: 4 additions & 4 deletions src/RuleSet/Php70.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,15 @@ final class Php70 extends AbstractRuleSet implements ExplicitRuleSet
'declare_strict_types' => true,
'dir_constant' => true,
'doctrine_annotation_array_assignment' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'operator' => ':',
],
'doctrine_annotation_braces' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'syntax' => 'without_braces',
],
'doctrine_annotation_indentation' => [
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
'indent_mixed_lines' => false,
],
'doctrine_annotation_spaces' => [
Expand All @@ -143,7 +143,7 @@ final class Php70 extends AbstractRuleSet implements ExplicitRuleSet
'before_argument_assignments' => false,
'before_array_assignments_colon' => false,
'before_array_assignments_equals' => false,
'ignored_tags' => self::DOCTRINE_IGNORED_TAGS,
'ignored_tags' => Doctrine::IGNORED_TAGS,
],
'echo_tag_syntax' => [
'format' => 'long',
Expand Down
Loading

0 comments on commit bab9a8d

Please sign in to comment.