Relative Content

Tag Archive for phpphpstan

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 […]