Skip to content

Commit

Permalink
Minor docblock updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
Bilge committed Dec 11, 2016
1 parent d32ae1e commit 263eb73
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/retry.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 263eb73

Please sign in to comment.