,error_levels?:string[]}> */ public function providerValidCodeParse(): iterable { return [ 'simpleVars' => [ ' [ '$a' => 'string', '$b' => 'string', ], ], 'simpleVarsWithSeparateTypes' => [ ' [ '$a' => 'string', '$b' => 'int', ], ], 'simpleVarsWithSeparateTypesInVar' => [ ' [ '$a' => 'string', '$b' => 'int', ], ], 'thisVar' => [ 'a, $this->b) = ["a", "b"]; return $this->a; } }', ], 'mixedNestedAssignment' => [ ' [ '$a' => 'mixed', '$b' => 'mixed', '$c' => 'mixed', ], ], 'explicitLiteralKey' => [ ' $a */ function takesList($a): void {} $a = [1, 1 => 2, 3]; takesList($a);', ], 'simpleTypeInfererNonEmptyList' => [ ' $vars */ function foo(array $vars): void { print_r($vars); } foo(Foo::VARS); ', ], ]; } /** * @return iterable */ public function providerInvalidCodeParse(): iterable { return [ 'thisVarWithBadType' => [ 'a, $this->b) = ["a", "b"]; return $this->a; } }', 'error_message' => 'InvalidPropertyAssignmentValue - src' . DIRECTORY_SEPARATOR . 'somefile.php:11', ], 'explicitVariableKey' => [ ' $a */ function takesList($a): void {} /** @return array-key */ function getKey() { return 0; } $a = [getKey() => 1]; takesList($a);', 'error_message' => 'MixedArgumentTypeCoercion', ], ]; } }