I'm a professional PHP, Python and Javascript developer from the UK. I've worked with Django, Laravel, and React, among others. I also maintain a legacy Zend 1 application.
In PHP I find Psalm incredibly useful for stuff like this. It will flag any discrepancies in your DocBlocks and can often fix them automatically. It also supports using DocBlocks to specify some quite complex type information, such as arrays with a specific structure.
Obviously type hints are the best way to specify this sort of thing since they're enforced by the compiler, but they can't always be as specific as DocBlocks can - you can enforce a return type being an array with a type hint, but you can't enforce the structure of said array.
Agree, and if the comment includes information like that, it is not a pure duplication of what the code already says. Different story though if PHP supports generics at some point.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
In PHP I find Psalm incredibly useful for stuff like this. It will flag any discrepancies in your DocBlocks and can often fix them automatically. It also supports using DocBlocks to specify some quite complex type information, such as arrays with a specific structure.
Obviously type hints are the best way to specify this sort of thing since they're enforced by the compiler, but they can't always be as specific as DocBlocks can - you can enforce a return type being an array with a type hint, but you can't enforce the structure of said array.
Agree, and if the comment includes information like that, it is not a pure duplication of what the code already says. Different story though if PHP supports generics at some point.