Skip to content
This repository has been archived by the owner on Dec 9, 2019. It is now read-only.

Commit

Permalink
Merge pull request #26 from miranrasulian/master
Browse files Browse the repository at this point in the history
Added a function_exists around the tap method
  • Loading branch information
jmarcher authored Sep 19, 2016
2 parents 7994151 + ea37637 commit 81349b9
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions cli/includes/helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,21 +117,32 @@ function should_be_sudo()
}
}

/**
/*
* Tap the given value.
*
* @param mixed $value
* @param mixed $value
* @param callable $callback
*
* @return mixed
*/
function tap($value, callable $callback)
{
$callback($value);

return $value;
if (!function_exists('tap')) {
/*
* Tap the given value.
*
* @param mixed $value
* @param callable $callback
*
* @return mixed
*/
function tap($value, callable $callback)
{
$callback($value);

return $value;
}
}


/**
* Get the user.
*/
Expand Down

0 comments on commit 81349b9

Please sign in to comment.