,error_levels?:string[]}> */ public function providerValidCodeParse(): iterable { return [ 'classAndPropertyAttributesExists' => [ ' [ ' [ ' [ 'getAttributes(BaseAttribute::class, 2) as $attr) { $attribute = $attr->newInstance(); echo $attribute->name; } }', [], [], '8.0' ], ]; } /** * @return iterable */ public function providerInvalidCodeParse(): iterable { return [ 'attributeClassHasNoAttributeAnnotation' => [ ' 'InvalidAttribute', [], false, '8.0' ], 'missingAttributeOnClass' => [ ' 'UndefinedAttributeClass', [], false, '8.0' ], 'missingAttributeOnFunction' => [ ' 'UndefinedAttributeClass', [], false, '8.0' ], 'missingAttributeOnParam' => [ ' 'UndefinedAttributeClass', [], false, '8.0' ], 'tooFewArgumentsToAttributeConstructor' => [ ' 'TooFewArguments', [], false, '8.0' ], 'invalidArgument' => [ ' 'InvalidScalarArgument', [], false, '8.0' ], 'classAttributeUsedOnFunction' => [ ' 'InvalidAttribute', [], false, '8.0' ], 'testReflectingClass74' => [ 'getAttributes(BaseAttribute::class, 2) as $attr) { $attribute = $attr->newInstance(); echo $attribute->name; } }', 'error_message' => 'UndefinedMethod', [], false, '7.4' ], 'interfaceCannotBeAttributeClass' => [ ' 'InvalidAttribute', [], false, '8.0' ], 'traitCannotBeAttributeClass' => [ ' 'InvalidAttribute', [], false, '8.0' ], 'abstractClassCannotBeAttributeClass' => [ ' 'InvalidAttribute', [], false, '8.0' ], 'abstractClassCannotHavePrivateConstructor' => [ ' 'InvalidAttribute', [], false, '8.0' ], ]; } }