With all the type hinting we get from php in 2024, do we need such (useless?) doc blocks anymore? Also would you add such a comment to this function, even though it's pretty clear what it does?
#PHP #Laravel
Back
•
If only PHP would support array of objects 🤓
public function foo(Bar[] $bars) {}
I use (and force to use in my company) the following logic: if it is type hintable, then no docblock.
If it is not type hintable, then use docblock.
For example, the stuff that PHP lacks: