Skip to content

Commit

Permalink
feature: make OrderedInterfacesFixer non-risky (#6722)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Jan 2, 2023
1 parent 72cf37c commit f5726f5
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 25 deletions.
4 changes: 0 additions & 4 deletions doc/list.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1916,10 +1916,6 @@ List of Available Rules

Orders the interfaces in an ``implements`` or ``interface extends`` clause.

*warning risky* Risky for ``implements`` when specifying both an interface and its parent
interface, because PHP doesn't break on ``parent, child`` but does on
``child, parent``.

Configuration options:

- | ``order``
Expand Down
10 changes: 0 additions & 10 deletions doc/rules/class_notation/ordered_interfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ Rule ``ordered_interfaces``

Orders the interfaces in an ``implements`` or ``interface extends`` clause.

Warning
-------

Using this rule is risky
~~~~~~~~~~~~~~~~~~~~~~~~

Risky for ``implements`` when specifying both an interface and its parent
interface, because PHP doesn't break on ``parent, child`` but does on ``child,
parent``.

Configuration
-------------

Expand Down
2 changes: 1 addition & 1 deletion doc/rules/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Class Notation
- `ordered_class_elements <./class_notation/ordered_class_elements.rst>`_

Orders the elements of classes/interfaces/traits/enums.
- `ordered_interfaces <./class_notation/ordered_interfaces.rst>`_ *(risky)*
- `ordered_interfaces <./class_notation/ordered_interfaces.rst>`_

Orders the interfaces in an ``implements`` or ``interface extends`` clause.
- `ordered_traits <./class_notation/ordered_traits.rst>`_ *(risky)*
Expand Down
10 changes: 0 additions & 10 deletions src/Fixer/ClassNotation/OrderedInterfacesFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ public function getDefinition(): FixerDefinitionInterface
]
),
],
null,
"Risky for `implements` when specifying both an interface and its parent interface, because PHP doesn't break on `parent, child` but does on `child, parent`."
);
}

Expand All @@ -109,14 +107,6 @@ public function isCandidate(Tokens $tokens): bool
|| $tokens->isAllTokenKindsFound([T_INTERFACE, T_EXTENDS]);
}

/**
* {@inheritdoc}
*/
public function isRisky(): bool
{
return true;
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit f5726f5

Please sign in to comment.