src/Functions.php
public static function wrap($function, $wrapper)
    {
        return function () use ($function, $wrapper) {
            $args = func_get_args();
            array_unshift($args, $function); // make $function the first argument
            return call_user_func_array($wrapper, $args);
        };
    }
public static function wrap($function, $wrapper)
    {
        return function () use ($function, $wrapper) {
            $args = func_get_args();
            array_unshift($args, $function); // make $function the first argument
            return call_user_func_array($wrapper, $args);
        };
    }
public static function wrap ( $ function , $ wrapper ) { return function ( ) use ( $ function , $ wrapper ) { $ args = func_get_args ( ) ; array_unshift ( $ args , $ function ) ; // make $function the first argument return call_user_func_array ( $ wrapper , $ args ) ; } ; }
Wraps the first function inside of the wrapper function, passing it as the first argument.

This allows the wrapper to execute code before and after the function runs,
adjust the arguments, and execute it conditionally.

@param callable $function
@param callable $wrapper
@return \Closure
Wraps the first function inside of the wrapper function passing it as the first argument .