Skip to content

Commit d4e71e5

Browse files
authored
Merge pull request #86 from nateritter/helper-tap-method-conflict-fix
Helper tap method conflict fix
2 parents 6906357 + e43f9a2 commit d4e71e5

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

cli/includes/helpers.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -108,18 +108,20 @@ function should_be_sudo()
108108
}
109109
}
110110

111-
/**
112-
* Tap the given value.
113-
*
114-
* @param mixed $value
115-
* @param callable $callback
116-
* @return mixed
117-
*/
118-
function tap($value, callable $callback)
119-
{
120-
$callback($value);
121-
122-
return $value;
111+
if (! function_exists('tap')) {
112+
/**
113+
* Tap the given value.
114+
*
115+
* @param mixed $value
116+
* @param callable $callback
117+
* @return mixed
118+
*/
119+
function tap($value, callable $callback)
120+
{
121+
$callback($value);
122+
123+
return $value;
124+
}
123125
}
124126

125127
/**

0 commit comments

Comments
 (0)