揮発性のメモ2

http://d.hatena.ne.jp/iww/

PhpStormで、PHPDocのエラーが取れない

<?
/**
 * add Mr.
 *
 * @param   string[]  $names  namelist
 * @return string[]  mrnamelist
 */
function getList($names)
{
    $list = array();
    foreach($names as $n) $list[] = "Mr.$n";
    return $list;
}

Return type does not match
A number of parameters, their names or types (if any) in PHPDoc comment do not match the ones in respective function or method declaration.


どう見ても合ってるのにエラーが取れないときはPhpStormがバグっているときなので、
カーソルを合わせたときに出る電球マークで @return の行をPhpStormに一旦自動生成させてから元に戻すと良い。