[ 'code' => 'self; } }', 'assertions' => [], 'ignored_issues' => [], 'php_version' => '8.1', ], 'nativeTypeIntersectionAsArgument' => [ 'code' => 'foo(); } test(new C()); ', 'assertions' => [], 'ignored_issues' => [], 'php_version' => '8.1', ], 'nativeTypeIntersectionAsClassProperty' => [ 'code' => 'intersection = new C(); } } ', 'assertions' => [], 'ignored_issues' => [], 'php_version' => '8.1', ], 'nativeTypeIntersectionAsClassPropertyUsingProcessedInterfaces' => [ 'code' => 'other = new AB(); } } ', 'assertions' => [], 'ignored_issues' => [], 'php_version' => '8.1', ], 'nativeTypeIntersectionAsClassPropertyUsingUnprocessedInterfaces' => [ 'code' => 'other = new StringableJson(); } } ', 'assertions' => [], 'ignored_issues' => [], 'php_version' => '8.1', ], ]; } public function providerInvalidCodeParse(): iterable { return [ 'invalidNativeIntersectionArgument' => [ 'code' => 'foo(); } test(new C()); ', 'error_message' => 'InvalidArgument', 'ignored_issues' => [], 'php_version' => '8.1', ], 'mismatchDocblockNativeIntersectionArgument' => [ 'code' => 'foo(); } ', 'error_message' => 'MismatchingDocblockParamType', 'ignored_issues' => [], 'php_version' => '8.1', ], 'intersectionsNotAllowedWithUnions' => [ 'code' => ' 'ParseError', 'ignored_issues' => [], 'php_version' => '8.1', ], 'intersectionsNotAllowedWithNonClasses' => [ 'code' => ' 'ParseError', 'ignored_issues' => [], 'php_version' => '8.1', ], 'intersectionsNotAllowedInPHP80' => [ 'code' => ' 'ParseError', 'ignored_issues' => [], 'php_version' => '8.0', ], 'nativeTypeIntersectionAsClassPropertyUsingUnknownInterfaces' => [ 'code' => 'other = new \Example\Unknown\AB(); } } ', // @todo decide whether a fall-back should be implemented, that allows to by-pass this failure (opt-in config) // `UndefinedClass - src/somefile.php:3:33 - Class, interface or enum named Example\Unknown\B does not exist` 'error_message' => 'UndefinedClass', 'ignored_issues' => [], 'php_version' => '8.1', ], ]; } }