You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm currently upgrading a first application to use PHP 8.3, and Rector recommends to use #[Override]. Gathering some pros and cons about this, I've found your article at https://stitcher.io/blog/override-in-php-83 that states:
I use an IDE that prevents me from making these kinds of mistakes
Can you explain this further? How could your IDE inform you that a parent classes method was renamed and you might consider renaming the method in your own class? How could a static analyzer detect this better?
The text was updated successfully, but these errors were encountered:
The IDE would not really inform you that a method was renamed, however:
If my method is overriding the parent's method I can see a clear icon indicator:
Unlike for a method that is not overriding anything:
If my method is being overridden by another class, I can also clearly see that:
If I'd like to rename a method, I should utilize the Rename refactorings shortcut, which would automatically rename the method in all classes that override it.
In summary, my IDE prevents me making mistakes while also providing me with additional information.
I'm currently upgrading a first application to use PHP 8.3, and Rector recommends to use
#[Override]
. Gathering some pros and cons about this, I've found your article at https://stitcher.io/blog/override-in-php-83 that states:Can you explain this further? How could your IDE inform you that a parent classes method was renamed and you might consider renaming the method in your own class? How could a static analyzer detect this better?
The text was updated successfully, but these errors were encountered: