[ ' [ ' [ 'barBar();', ], 'staticInvocation' => [ ' [ ' [ ' [ 'sub(new DateInterval("P1D")); $b = (new DateTimeImmutable())->modify("+3 hours");', 'assertions' => [ '$yesterday' => 'MyDate', '$b' => 'DateTimeImmutable', ], ], ]; } /** * @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', ], ]; } }