Fork me on GitHub
a Sensio Labs Product

Persian Successor (v3.68.1) edition

Rule general_attribute_remove

Removes configured attributes by their respective FQN.

Configuration

attributes

List of FQNs of attributes for removal.

Allowed types: list<class-string>

Default value: []

Examples

Example #1

With configuration: ['attributes' => ['\\A\\B\\Foo']].

--- Original
+++ New
 <?php
-#[\A\B\Foo]
 function foo() {}

Example #2

With configuration: ['attributes' => ['\\A\\B\\Foo', 'A\\B\\Bar']].

--- Original
+++ New
 <?php
 use A\B\Bar as BarAlias;

-#[\A\B\Foo]
-#[BarAlias]
 function foo() {}

References

The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.