src/Traver/Collection/PipeableLike.php
/**
     * Wraps the given callback in a callback which has two arguments (value, key),
     * if the given callback accepts only one argument (assumed as value).
     * Allows for callbacks which expect exactly one argument like {@link ucfirst} or {@link is_string},
     * @param callable $callback
     * @return \Closure
     */
Wraps the given callback in a callback which has two arguments (value, key),
if the given callback accepts only one argument (assumed as value).
Allows for callbacks which expect exactly one argument like  ucfirst or  is_string,
@param callable $callback
@return \Closure
Wraps the given callback in a callback which has two arguments ( value key ) if the given callback accepts only one argument ( assumed as value ) . Allows for callbacks which expect exactly one argument like ucfirst or is_string @param callable $callback @return \ Closure
protected static function wrapCallback(callable $callback)
    {
        $reflection = Callbacks::createReflectionFunction($callback);
        $numberOfParameters = $reflection->getNumberOfParameters();
        $proxy = $callback;
        if ($numberOfParameters == 1) {
            $proxy = function ($value, $key) use ($callback) {
                return $callback($value);
            };
        }
        return $proxy;
    }
protected static function wrapCallback ( callable $ callback ) { $ reflection = Callbacks :: createReflectionFunction ( $ callback ) ; $ numberOfParameters = $ reflection -> getNumberOfParameters ( ) ; $ proxy = $ callback ; if ( $ numberOfParameters == 1 ) { $ proxy = function ( $ value , $ key ) use ( $ callback ) { return $ callback ( $ value ) ; } ; } return $ proxy ; }
Wraps the given callback in a callback which has two arguments (value, key),
 if the given callback accepts only one argument (assumed as value).
Wraps the given callback in a callback which has two arguments ( value key ) if the given callback accepts only one argument ( assumed as value ) .
/** @noinspection PhpUnusedParameterInspection */ /** @noinspection PhpDocSignatureInspection */