public static function mock(string $function): MockedFunction
    {
        $mock = new MockedFunction($function);

        self::$mocks[] = $mock;

        $closure = new ClosureGenerator($function);

        uopz_set_return($function, $closure->generate(), true);

        return $mock;
    }
public static function mock(string $function): MockedFunction
    {
        $mock = new MockedFunction($function);

        self::$mocks[] = $mock;

        $closure = new ClosureGenerator($function);

        uopz_set_return($function, $closure->generate(), true);

        return $mock;
    }
public static function mock ( string $ function ) : MockedFunction { $ mock = new MockedFunction ( $ function ) ; self :: $ mocks [ ] = $ mock ; $ closure = new ClosureGenerator ( $ function ) ; uopz_set_return ( $ function , $ closure -> generate ( ) , true ) ; return $ mock ; }
Set up a core function to be mocked.

@param string $function The name of the function to be mocked

@return MockedFunction
Set up a core function to be mocked .