phpactor
phpactor copied to clipboard
False positive for missing method param
This code snippet here results in Method "array" is missing @param $input
even though it is specified in the PHPDoc. It likely has something to do with the definition syntax that PHPStan supports.
declare(strict_types=1);
namespace App;
class Asd
{
/**
* @param array{0: 'w', 1: 'o', 2: 'r', 3: 'l', 4: 'd'} $input
*
* @return 'world'
*/
public function hello(array $input): string
{
return implode('', $input);
}
}
Possibly related to https://github.com/phpactor/phpactor/issues/2264