PHPStan not recognizing type specification for generic type
PHPStan is not recognizing my type specification in my docblock preceeding a method.
phpstan: assign.readOnlyProperty
The following class
PHPStan cannot access property on mixed
I have a section of code as follows
can PHPStan detect that a @param can be an array of int, an array of string but not a mix of int and string?
readonly class Identifier extends Regexp { /** * @param array<int,int>|array<int,string> $possibleValues */ public function __construct(array $possibleValues = []) { $regexp = implode(‘|’, $possibleValues); parent::__construct(” !== $regexp ? $regexp : null); } } Everything works fine when i create an Identifierwith an array that contains a float, phpstan detects an error. But it does not detect […]
Throw php generic from generics trace
I have some method with generic: