[ 'getMessage(); }', ], 'PHP7-rethrowInterfaceExceptionWithoutInvalidThrow' => [ ' [ ' [ '$worked' => 'bool', ], ], 'alwaysReturnsBecauseCatchDoesNothing' => [ ' [ ' [ 'getMessage(); // do nothing here either } finally { return true; } }', ], ]; } /** * @return array */ public function providerFileCheckerInvalidCodeParse() { return [ 'invalidCatchClass' => [ ' 'InvalidCatch', ], 'invalidThrowClass' => [ ' 'InvalidThrow', ], 'theresNoCatch' => [ ' 'InvalidReturnType', ], 'catchDoesNotReturn' => [ ' 'InvalidReturnType', ], 'catchWithNoReturnAndFinallyDoesNotReturn' => [ 'getMessage(); // do nothing here either } finally { } }', 'error_message' => 'InvalidReturnType', ], 'catchWithNoReturnAndNoFinally' => [ 'getMessage(); // do nothing here either } }', 'error_message' => 'InvalidReturnType', ], ]; } }