noverify
noverify copied to clipboard
Linter doesn't inherit phpDoc types
PHP Version: 7.4.28
OS: Debian Buster
Run command:
php-linter check --kphp --kphp7
The minimal code in which the bug appears:
Let's say we define an abstract class and extending class
abstract class A {
/**
* @param mixed[] $user
*/
abstract public function foo(array $user);
}
class B {
/**
* @inheritDoc
*/
public function foo(array $user) {
...
}
}
Actual Behavior:
Linter says "Specify the type for the parameter $user in PHPDoc, 'array' type hint is too generic.
Expected Behavior:
I expect linter to inherit mixed[] type from base class method. This is how kphp actually work.