diff --git a/src/retry.php b/src/retry.php index 7f7f2a5..e1a9e60 100644 --- a/src/retry.php +++ b/src/retry.php @@ -2,22 +2,18 @@ namespace ScriptFUSION\Retry; /** - * Tries the specified operation up to the specified number of times. If - * specified, the error handler will be called immediately before retrying the - * operation. + * Tries the specified operation up to the specified number of times. If specified, the exception handler will be + * called immediately before retrying the operation. * * @param int $tries Number of times. * @param callable $operation Operation. - * @param callable $onError Optional. Error handler. + * @param callable $onError Optional. Exception handler. * - * @return mixed Result of running the operation if tries is greater than zero, - * otherwise null. + * @return mixed Result of running the operation if tries is greater than zero, otherwise null. */ function retry($tries, callable $operation, callable $onError = null) { - $tries |= 0; - - if ($tries <= $attempts = 0) { + if (($tries |= 0) <= $attempts = 0) { return; }