-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor get_sites() extension to improve readability #158
Conversation
Hello good-old pass-by-ref :( Please use properties for passing data around. |
Co-authored-by: Viktor Szépe <[email protected]>
@szepeviktor I switched to properties and now 15 assertions fail. 😞 I'll need some time to figure out what's going on. |
Properties add state to those classes making them mutable. Could be that one line of analysed code sets a property that is then incorrectly used for another line of analysed code? |
I replaced |
Just one more thing though. A get* method that doesn't return anything but changes some state is one of the things that keeps me from sleeping at night xD Most likely the simplest and safest thing is just to return the relevant values as an array and type it for phpstan with an array shape. You can use it in a sane way via e.g. |
OK too slow 😅 as long as it works |
Mine is |
Oh no, stop it... |
@herndlm Please star my next gen WordPress: https://github.com/szepeviktor/WordPress-the-good-parts |
Viktor stop trying to sell me your passive aggressive empty repo 😅 |
Refactors the dynamic function return type extension for
get_sites()
to improve readability.Last PR addressing this extension 😇