,error_levels?:string[]}> */ public function providerValidCodeParse(): iterable { return [ 'functionTypeHints' => [ ' [ '$a' => 'int', ], ], 'methodTypeHints' => [ ' [ '$a' => 'int', ], ], 'nullCoalesce' => [ ' [ '$a' => 'null|string', ], ], 'nullCoalesceWithNullableOnLeft' => [ ' 5 ? "hello" : null; } $a = foo() ?? "goodbye";', 'assertions' => [ '$a' => 'string', ], ], 'nullCoalesceWithReference' => [ ' [ '$a' => 'int', ], ], 'spaceship' => [ ' 1;', 'assertions' => [ '$a' => 'int', ], ], 'defineArray' => [ ' [ '$a' => 'string', ], ], 'anonymousClassLogger' => [ 'logger = $logger; } } $app = new Application; $app->setLogger(new class implements Logger { /** @return void */ public function log(string $msg) { echo $msg; } });', ], 'anonymousClassFunctionReturnType' => [ 'f());', ], 'anonymousClassStatement' => [ ' [ 'i = new class implements I {}; } public function foo2(): void {} // commenting this line out fixes }', ], 'anonymousClassExtendsWithThis' => [ 'foo(); return 42; } };', ], 'returnAnonymousClass' => [ ' [ ' [ ' */ public function providerInvalidCodeParse(): iterable { return [ 'anonymousClassWithBadStatement' => [ ' 'UndefinedClass', ], 'anonymousClassWithInvalidFunctionReturnType' => [ ' 'InvalidReturnStatement', ], ]; } }