Closed szepeviktor closed 5 years ago
Hello Viktor!
Sorry to ask, I'm not totally aware of these sort of things... Could you tell me why you suggest not to use else
? Is it in this specific case or is it a general recommandation?
else
adds a branch, it'll be more complex, and those pesky indentations!
Some standards ban them: https://github.com/object-calisthenics/phpcs-calisthenics-rules#2-do-not-use-else-keyword
And my favourite: https://youtu.be/5DVDewOReoY?t=404
Another good one from the same person: https://www.youtube.com/watch?v=crSUWtRYw-M
Aha. You (and Adam Wathan) convinced me :) I will merge your PR and will try to do this way in the billions of places where I did it badly. As and as I will refactor classes... Thanks for the hint.
else
is no one's friend