================================= Rule ``no_unneeded_final_method`` ================================= Removes ``final`` from methods where possible. Warning ------- Using this rule is risky ~~~~~~~~~~~~~~~~~~~~~~~~ Risky when child class overrides a ``private`` method. Configuration ------------- ``private_methods`` ~~~~~~~~~~~~~~~~~~~ Private methods of non-``final`` classes must not be declared ``final``. Allowed types: ``bool`` Default value: ``true`` Examples -------- Example #1 ~~~~~~~~~~ *Default* configuration. .. code-block:: diff --- Original +++ New false]``. .. code-block:: diff --- Original +++ New `_ - `@PHP82Migration:risky <./../../ruleSets/PHP82MigrationRisky.rst>`_ - `@PhpCsFixer:risky <./../../ruleSets/PhpCsFixerRisky.rst>`_ - `@Symfony:risky <./../../ruleSets/SymfonyRisky.rst>`_ References ---------- - Fixer class: `PhpCsFixer\\Fixer\\ClassNotation\\NoUnneededFinalMethodFixer <./../../../src/Fixer/ClassNotation/NoUnneededFinalMethodFixer.php>`_ - Test class: `PhpCsFixer\\Tests\\Fixer\\ClassNotation\\NoUnneededFinalMethodFixerTest <./../../../tests/Fixer/ClassNotation/NoUnneededFinalMethodFixerTest.php>`_ The test class defines officially supported behaviour. Each test case is a part of our backward compatibility promise.