[ ' [ ['int' => '$a'] ] ], 'methodTypeHints' => [ ' [ ['int' => '$a'] ] ], 'nullCoalesce' => [ ' [ ['mixed' => '$a'] ], 'error_levels' => ['MixedAssignment'] ], 'spaceship' => [ ' 1;', 'assertions' => [ ['int' => '$a'] ] ], 'defineArray' => [ ' [ ['string' =>'$a'] ] ], 'anonymousClassLogger' => [ 'logger = $logger; } } $app = new Application; $app->setLogger(new class implements Logger { public function log(string $msg) { echo $msg; } });' ], 'anonymousClassFunctionReturnType' => [ 'f());' ], 'generatorWithReturn' => [ ' * @psalm-generator-return string */ function fooFoo(int $i) : Generator { if ($i === 1) { return "bash"; } yield 1; }' ], 'generatorDelegation' => [ ' * @psalm-generator-return int */ function count_to_ten() : Generator { yield 1; yield 2; yield from [3, 4]; yield from new ArrayIterator([5, 6]); yield from seven_eight(); return yield from nine_ten(); } /** * @return Generator */ function seven_eight() : Generator { yield 7; yield from eight(); } /** * @return Generator */ function eight() : Generator { yield 8; } /** * @return Generator * @psalm-generator-return int */ function nine_ten() : Generator { yield 9; return 10; } $gen = count_to_ten(); foreach ($gen as $num) { echo "$num "; } $gen2 = $gen->getReturn();', 'assertions' => [ ['Generator' => '$gen'], ['mixed' => '$gen2'] ], 'error_levels' => ['MixedAssignment'] ], 'multipleUse' => [ ' [ ' 'UndefinedClass' ], 'anonymousClassWithInvalidFunctionReturnType' => [ ' 'InvalidReturnType' ] ]; } }