,error_levels?:string[]}> */ public function providerValidCodeParse(): iterable { return [ 'nestedTemplateExtends' => [ ' */ abstract class BaseRepository {} class StudentViewData implements IBaseViewData {} class TeacherViewData implements IBaseViewData {} /** @extends BaseModel */ class StudentModel extends BaseModel {} /** @extends BaseModel */ class TeacherModel extends BaseModel {} /** @extends BaseRepository */ class StudentRepository extends BaseRepository {} /** @extends BaseRepository */ class TeacherRepository extends BaseRepository {}' ], 'unwrapIndirectGenericTemplated' => [ ' * @param TWrapper2 $wrapper * @return TInner2 */ function indirectUnwrap(Wrapper $wrapper) : object { return unwrapGeneric($wrapper); } /** * @template TInner1 * @template TWrapper1 of Wrapper * @param TWrapper1 $wrapper * @return TInner1 */ function unwrapGeneric(Wrapper $wrapper) { return $wrapper->unwrap(); }' ], 'unwrapFromTemplatedClassString' => [ ' */ class StringWrapper implements Wrapper { public function unwrap() { return "hello"; } } /** * @template TInner * @template TWrapper of Wrapper * * @param class-string $class * @return TInner */ function load(string $class) { $package = new $class(); return $package->unwrap(); } $result = load(StringWrapper::class);' ], 'unwrapNestedTemplateWithReset' => [ ' * @param TArray $arr * @return TValue */ function toList(array $arr): array { return reset($arr); }' ], ]; } /** * @return iterable */ public function providerInvalidCodeParse(): iterable { return [ 'nestedTemplateExtendsInvalid' => [ ' */ abstract class BaseRepository {} class StudentViewData implements IBaseViewData {} class TeacherViewData implements IBaseViewData {} /** @extends BaseModel */ class StudentModel extends BaseModel {} /** @extends BaseModel */ class TeacherModel extends BaseModel {} /** @extends BaseRepository */ class StudentRepository extends BaseRepository {}', 'error_message' => 'InvalidTemplateParam' ], ]; } }