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

79

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

/ 1000

depends some are needed when using larastan

12

If only PHP would support array of objects 🤓

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

11

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

64