My code review was refused by my co-worker, because of an unnecessary phpdoc on a local array ($params in bottom example) in a function. See the example:
/**
* comment...
*
* @return int
*/
public function testFunction()
{
/** @var string[] $params */
$params = ['string1', 'string2'];
etc...
return 0;
}
Can someone explain to me why defining phpdocs on local arrays is unnecessary? I got an explanation from my co-worker that we don't need to write phpdocs on local arrays. We are using PhpStorm and Doctrine.
Thanks for your time.