markTestSkipped('Cannot run test, base class "mysqli" does not exist!'); } $this->addFile( 'somefile.php', ',ignored_issues?:list}> */ public function providerValidCodeParse(): iterable { return [ 'overrideProtectedAccessLevelToPublic' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => 'foo(); } }', ], 'missingParentWithFunction' => [ 'code' => ' [], 'ignored_issues' => [ 'UndefinedClass', 'MissingReturnType', ], ], 'subclassWithSimplerArg' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ '$object' => 'Bar|Foo', ], ], 'instantiateClassAndIsA' => [ 'code' => 'bar(); }', ], 'returnStringAfterIsACheckWithClassConst' => [ 'code' => ' [ 'code' => ' [ 'code' => ' $array */ function foo(array $array, string $key) : void { foreach ($array as $i => $item) { $array[$key] = new class() {}; if ($array[$i] === $array[$key]) {} } }', ], 'getClassSelfClass' => [ 'code' => 'baz(); } return ""; } public function baz(): string { return "baz"; } }', ], 'staticClassComparison' => [ 'code' => 'baz(); } return ""; } public static function foo2(): string { if (static::class === D::class) { return static::bat(); } return ""; } } class D extends C { public function baz(): string { return "baz"; } public static function bat(): string { return "baz"; } }', ], 'isAStaticClass' => [ 'code' => 'baz(); } return ""; } public static function foo2(): string { if (is_a(static::class, D::class, true)) { return static::bat(); } return ""; } } class D extends C { public function baz(): string { return "baz"; } public static function bat(): string { return "baz"; } }', ], 'typedMagicCall' => [ 'code' => 'zugzug(); $b = (new A)->bar()->baz();', 'assertions' => [ '$a' => 'B', '$b' => 'string', ], ], 'abstractCallToInterfaceMethod' => [ 'code' => 'fooBar(); } }', ], 'noCrashWhenIgnoringUndefinedClass' => [ 'code' => ' [], 'ignored_issues' => [ 'UndefinedClass', ], ], 'noCrashWhenIgnoringUndefinedParam' => [ 'code' => ' [], 'ignored_issues' => [ 'UndefinedClass', 'InvalidArgument', ], ], 'noCrashWhenIgnoringUndefinedReturnIterableArg' => [ 'code' => ' [], 'ignored_issues' => [ 'UndefinedClass', 'MixedInferredReturnType', 'InvalidArgument', ], ], 'noCrashWhenIgnoringUndefinedReturnClassArg' => [ 'code' => ' [], 'ignored_issues' => [ 'UndefinedClass', 'MixedInferredReturnType', 'InvalidArgument', ], ], 'allowAbstractInstantiationOnPossibleChild' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [], 'ignored_issues' => ['PropertyNotSetInConstructor'], ], 'classAliasNoException' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => 'mock(); return $b; }' ], 'allowTraversableImplementationAlongWithIteratorAggregate' => [ 'code' => ' [ 'code' => ' [ 'code' => ' [ 'code' => ',php_version?:string}> */ public function providerInvalidCodeParse(): iterable { return [ 'undefinedClass' => [ 'code' => ' 'UndefinedClass', ], 'wrongCaseClass' => [ 'code' => ' 'InvalidClass', ], 'wrongCaseClassWithCall' => [ 'code' => ' 'InvalidClass', ], 'invalidThisFetch' => [ 'code' => ' 'InvalidScope', ], 'invalidThisArgument' => [ 'code' => ' 'InvalidScope', ], 'undefinedConstant' => [ 'code' => ' 'UndefinedConstant', ], 'undefinedClassConstant' => [ 'code' => ' 'UndefinedConstant', ], 'overridePublicAccessLevelToPrivate' => [ 'code' => ' 'OverriddenMethodAccess', ], 'overridePublicAccessLevelToProtected' => [ 'code' => ' 'OverriddenMethodAccess', ], 'overrideProtectedAccessLevelToPrivate' => [ 'code' => ' 'OverriddenMethodAccess', ], 'overridePublicPropertyAccessLevelToPrivate' => [ 'code' => ' 'OverriddenPropertyAccess', ], 'overridePublicPropertyAccessLevelToProtected' => [ 'code' => ' 'OverriddenPropertyAccess', ], 'overrideProtectedPropertyAccessLevelToPrivate' => [ 'code' => ' 'OverriddenPropertyAccess', ], 'classRedefinition' => [ 'code' => ' 'DuplicateClass', ], 'classRedefinitionInNamespace' => [ 'code' => ' 'DuplicateClass', ], 'classRedefinitionInSeparateNamespace' => [ 'code' => ' 'DuplicateClass', ], 'abstractClassInstantiation' => [ 'code' => ' 'AbstractInstantiation', ], 'abstractClassMethod' => [ 'code' => ' 'UnimplementedAbstractMethod', ], 'abstractReflectedClassMethod' => [ 'code' => ' 'UnimplementedAbstractMethod', ], 'missingParent' => [ 'code' => ' 'UndefinedClass', ], 'lessSpecificReturnStatement' => [ 'code' => ' 'LessSpecificReturnStatement', ], 'circularReference' => [ 'code' => ' 'CircularReference', ], 'preventAbstractInstantiationDefiniteClasss' => [ 'code' => ' 'AbstractInstantiation', ], 'preventExtendingInterface' => [ 'code' => ' 'UndefinedClass', ], 'preventImplementingClass' => [ 'code' => ' 'UndefinedInterface', ], 'classAliasAlreadyDefinedClass' => [ 'code' => ' 'TypeDoesNotContainType', ], 'cannotOverrideFinalType' => [ 'code' => ' 'MethodSignatureMismatch', ], 'preventFinalOverriding' => [ 'code' => 'foo();', 'error_message' => 'LessSpecificReturnStatement', ], 'preventTraversableImplementation' => [ 'code' => ' 'InvalidTraversableImplementation', ], 'preventIndirectTraversableImplementation' => [ 'code' => ' 'InvalidTraversableImplementation', ], ]; } }