[ 'foo(); }', ], 'assertInstanceOfInterface' => [ 'bar(); $a->foo(); }', ], 'assertInstanceOfMultipleInterfaces' => [ 'bar(); $a->foo1(); }', ], 'assertInstanceOfBInClassMethod' => [ 'assertInstanceOfB($a); $a->foo(); } }', ], 'assertPropertyNotNull' => [ 'a) { throw new \Exception(); } } public function takesA(A $a): void { $this->assertNotNullProperty(); $a->foo(); } }', ], 'assertInstanceOfBAnnotation' => [ 'foo(); }', ], 'assertIfTrueAnnotation' => [ ' [ ' [ ' [ 'sayHello();' ], 'dontBleedBadAssertVarIntoContext' => [ 'foo()); assertFalse($a->bar()); }' ], ]; } /** * @return array */ public function providerInvalidCodeParse() { return [ 'assertInstanceOfMultipleInterfaces' => [ 'bar(); $a->foo1(); }', 'error_message' => 'UndefinedMethod', ], 'assertIfTrueNoAnnotation' => [ ' 'PossiblyNullOperand', ], 'assertIfFalseNoAnnotation' => [ ' 'PossiblyNullOperand', ], 'assertIfTrueMethodCall' => [ 'isInt($p)) { strlen($p); } } }', 'error_message' => 'InvalidScalarArgument', ], 'assertIfStaticTrueMethodCall' => [ 'isInt($p)) { strlen($p); } } }', 'error_message' => 'InvalidScalarArgument', ], 'noFatalForUnknownAssertClass' => [ 'sayHello();', 'error_message' => 'UndefinedClass', ], 'detectRedundantCondition' => [ ' 'RedundantCondition' ], ]; } }