Back

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

image

3

111

  • No matching results...
  • Searching...

/ 1000

depends some are needed when using larastan

13

If only PHP would support array of objects 🤓

public function foo(Bar[] $bars) {}

14

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:
image

87