,error_levels?:string[]}> */ public function providerValidCodeParse() { return [ 'callMapClassOptionalArg' => [ 'invoke(null, "cool");', ], 'sortFunctions' => [ ' 5, "a" => 8]; ksort($a); $b = ["b" => 5, "a" => 8]; sort($b); ', 'assertions' => [ '$a' => 'array{a: int, b: int}', '$b' => 'array', ], ], 'arrayModificationFunctions' => [ ' 5, "a" => 8]; array_unshift($a, (bool)rand(0, 1)); $b = ["b" => 5, "a" => 8]; array_push($b, (bool)rand(0, 1)); ', 'assertions' => [ '$a' => 'non-empty-array', '$b' => 'non-empty-array', ], ], 'byRefArgAssignment' => [ ' [ ' [ ' [ ' $arr */ function foo(array $arr) : void { } /** @return array */ function bar() : array { return []; } /** @psalm-suppress InvalidScalarArgument */ foo(bar());', ], 'allowArrayScalarForArrayStringWithScalarIgnored' => [ ' $arr */ function foo(array $arr) : void {} /** @return array */ function bar() : array { return []; } /** @psalm-suppress InvalidScalarArgument */ foo(bar());', ], ]; } /** * @return iterable */ public function providerInvalidCodeParse() { return [ 'possiblyInvalidArgument' => [ ' 'PossiblyInvalidArgument', ], 'possiblyInvalidArgumentWithOverlap' => [ ' 'PossiblyInvalidArgument', ], ]; } }