[ ' [ ' [ 'barBar();', ], 'staticInvocation' => [ ' [ ' [ ' [ 'sub(new DateInterval("P1D")); $b = (new DateTimeImmutable())->modify("+3 hours");', 'assertions' => [ '$yesterday' => 'MyDate', '$b' => 'DateTimeImmutable', ], ], 'magicCall' => [ 'bar();', ], 'canBeCalledOnMagic' => [ 'maybeUndefinedMethod();', 'assertions' => [], 'error_levels' => ['PossiblyUndefinedMethod'], ], ]; } /** * @return array */ public function providerFileCheckerInvalidCodeParse() { return [ 'staticInvocation' => [ ' 'InvalidStaticInvocation', ], 'parentStaticCall' => [ ' 'InvalidStaticInvocation', ], 'mixedMethodCall' => [ 'barBar();', 'error_message' => 'MixedMethodCall', 'error_levels' => [ 'MissingPropertyType', 'MixedAssignment', ], ], 'invalidMethodCall' => [ 'someMethod();', 'error_message' => 'InvalidMethodCall', ], 'possiblyInvalidMethodCall' => [ 'methodOfA(); } }', 'error_message' => 'PossiblyInvalidMethodCall', ], 'selfNonStaticInvocation' => [ ' 'NonStaticSelfCall', ], 'noParent' => [ ' 'ParentNotFound', ], 'coercedClass' => [ ' 'LessSpecificReturnStatement', 'error_levels' => ['MixedInferredReturnType', 'MixedReturnStatement'], ], 'undefinedVariableStaticCall' => [ ' 'UndefinedGlobalVariable', ], 'staticCallOnString' => [ ' 'MixedAssignment', ], 'possiblyNullFunctionCall' => [ 'foo();', 'error_message' => 'InvalidScope', ], 'possiblyFalseReference' => [ 'bar();', 'error_message' => 'PossiblyFalseReference', ], 'undefinedParentClass' => [ ' 'MissingDependency - src/somefile.php:7', ], 'variableMethodCallOnArray' => [ '$b();', 'error_message' => 'InvalidMethodCall', ], 'intVarStaticCall' => [ ' 'UndefinedClass', ], 'intVarNewCall' => [ ' 'UndefinedClass', ], ]; } }