public function once($callable)
    {
        return function (Container $container) use ($callable) {
            static $called = false;
            static $result;

            if (false === $called) {
                $result = $callable($container);
                $called = true;
            }

            return $result;
        };
    }
public function once($callable)
    {
        return function (Container $container) use ($callable) {
            static $called = false;
            static $result;

            if (false === $called) {
                $result = $callable($container);
                $called = true;
            }

            return $result;
        };
    }
public function once ( $ callable ) { return function ( Container $ container ) use ( $ callable ) { static $ called = false ; static $ result ; if ( false === $ called ) { $ result = $ callable ( $ container ) ; $ called = true ; } return $ result ; } ; }
Returns a closure that will only invoke the given callable once. Each
subsequent call will return the same result from the first invocation.
The invoked callable will receive this service container as its only
parameter.

@param callable $callable A callback.

@return Closure The closure.
Returns a closure that will only invoke the given callable once . Each subsequent call will return the same result from the first invocation . The invoked callable will receive this service container as its only parameter .