Skip to content

Create RemoveUselessReadOnlyTagRector that handles @final #9662

@kkmuffme

Description

@kkmuffme

Feature Request

https://getrector.com/rule-detail/remove-useless-read-only-tag-rector handles unnecessary @readonly when there is a native keyword.

It would be great if there was this a RemoveUselessFinalTagRector that does the same thing, just for the @Final phpdoc in PHP 8+

And also for @Final on private methods (or possibly as a separate rule), which currently already exists for final keyword only https://getrector.com/rule-detail/final-private-to-private-visibility-rector but not for phpdoc tags

Diff

-    /**
-     * @final
-     */
     final public function foo() {}

-    /**
-     * @final
-     */
     private function bar() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions