-
Hello, PHP 8.3 introduced the This attribute can be added to methods to ensure the method is overriding a method from a parent class or interface. Now, I'd like to enforce it on my project, but I can't find any setting or tool to do this automatically. Is this something in the scope of CS Fixer? If not, is there another tool that has this feature? I found that Psalm has an option to throw an error if the attribute is not present (https://psalm.dev/docs/running_psalm/configuration/#ensureoverrideattribute), but I couldn't find anything that automatically adds this attribute to methods. Thank you 😊 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
PHP-CS-Fixer does not have an inheritance context, so it can't determine such methods. Luckily there's a Rector rule for that 🙂. |
Beta Was this translation helpful? Give feedback.
PHP-CS-Fixer does not have an inheritance context, so it can't determine such methods. Luckily there's a Rector rule for that 🙂.