[ ' [ ' [ ' [ 'foo(); } }', ], 'missingParentWithFunction' => [ ' [], 'error_levels' => [ 'UndefinedClass', 'MissingReturnType', ], ], 'subclassWithSimplerArg' => [ ' [ ' [ ' [ '$object' => 'Foo|Bar', ], ], 'instantiateClassAndIsA' => [ 'bar(); }', ], 'returnStringAfterIsACheckWithClassConst' => [ ' [ ' [ ' [ ' $array * @psalm-suppress MixedAssignment */ function foo(array $array, string $key) : void { foreach ($array as $i => $item) { $array[$key] = new class() {}; if ($array[$i] === $array[$key]) {} } }', ], ]; } /** * @return array */ public function providerFileCheckerInvalidCodeParse() { return [ 'undefinedClass' => [ ' 'UndefinedClass', ], 'wrongCaseClass' => [ ' 'InvalidClass', ], 'wrongCaseClassWithCall' => [ ' 'InvalidClass', ], 'invalidThisFetch' => [ ' 'InvalidScope', ], 'invalidThisArgument' => [ ' 'InvalidScope', ], 'undefinedConstant' => [ ' 'UndefinedConstant', ], 'undefinedClassConstant' => [ ' 'UndefinedConstant', ], 'overridePublicAccessLevelToPrivate' => [ ' 'OverriddenMethodAccess', ], 'overridePublicAccessLevelToProtected' => [ ' 'OverriddenMethodAccess', ], 'overrideProtectedAccessLevelToPrivate' => [ ' 'OverriddenMethodAccess', ], 'overridePublicPropertyAccessLevelToPrivate' => [ ' 'OverriddenPropertyAccess', ], 'overridePublicPropertyAccessLevelToProtected' => [ ' 'OverriddenPropertyAccess', ], 'overrideProtectedPropertyAccessLevelToPrivate' => [ ' 'OverriddenPropertyAccess', ], 'classRedefinition' => [ ' 'DuplicateClass', ], 'classRedefinitionInNamespace' => [ ' 'DuplicateClass', ], 'classRedefinitionInSeparateNamespace' => [ ' 'DuplicateClass', ], 'abstractClassInstantiation' => [ ' 'AbstractInstantiation', ], 'abstractClassMethod' => [ ' 'UnimplementedAbstractMethod', ], 'missingParent' => [ ' 'UndefinedClass', ], 'lessSpecificReturnStatement' => [ ' 'LessSpecificReturnStatement', ], 'circularReference' => [ ' 'CircularReference', ], ]; } }