,error_levels?:string[]}> */ public function providerValidCodeParse(): iterable { return [ 'basicClassStringMap' => [ ' */ public static array $map = []; /** * @template T as Foo * @param class-string $class * @return T */ public function get(string $class) : Foo { if (isset(self::$map[$class])) { return self::$map[$class]; } self::$map[$class] = new $class(); return self::$map[$class]; } }', ], 'basicClassStringMapDifferentTemplateName' => [ ' */ public static array $map = []; /** * @template U as Foo * @param class-string $class * @return U */ public function get(string $class) : Foo { if (isset(self::$map[$class])) { return self::$map[$class]; } self::$map[$class] = new $class(); return self::$map[$class]; } }', ], ]; } /** * @return iterable */ public function providerInvalidCodeParse(): iterable { return [ 'assignInvalidClass' => [ ' */ public static array $map = []; /** * @template T * @param class-string $class */ public function get(string $class) : void { self::$map[$class] = 5; } }', 'error_message' => 'InvalidPropertyAssignmentValue' ], 'assignInvalidClassDifferentTemplateName' => [ ' */ public static array $map = []; /** * @template U * @param class-string $class */ public function get(string $class) : void { self::$map[$class] = 5; } }', 'error_message' => 'InvalidPropertyAssignmentValue' ], ]; } }