src/ServiceProvider.php
public function register(Container $container)
    {
        $that = $this;

        $container[self::CLASS_RESOLVER] = function () use ($that, $container) {
            $resolver = new ClassResolver($that->getEventDispatcher($container));
            $that->bindContainer($resolver, $container);

            return $resolver;
        };

        $container[$this->makeMethod] = $container->protect(
            function ($abstract, $parameters = array()) use ($container) {
                return $container[ServiceProvider::CLASS_RESOLVER]
                    ->resolve($abstract, $parameters);
            }
        );

        $container[$this->bindMethod] = $container->protect(
            function ($abstract, $concrete, $protect = false) use ($container) {
                return $container[ServiceProvider::CLASS_RESOLVER]
                    ->bind($abstract, $concrete, $protect);
            }
        );
    }
public function register(Container $container)
    {
        $that = $this;

        $container[self::CLASS_RESOLVER] = function () use ($that, $container) {
            $resolver = new ClassResolver($that->getEventDispatcher($container));
            $that->bindContainer($resolver, $container);

            return $resolver;
        };

        $container[$this->makeMethod] = $container->protect(
            function ($abstract, $parameters = array()) use ($container) {
                return $container[ServiceProvider::CLASS_RESOLVER]
                    ->resolve($abstract, $parameters);
            }
        );

        $container[$this->bindMethod] = $container->protect(
            function ($abstract, $concrete, $protect = false) use ($container) {
                return $container[ServiceProvider::CLASS_RESOLVER]
                    ->bind($abstract, $concrete, $protect);
            }
        );
    }
Registers services on the given container.

This method should only be used to configure services and parameters.
It should not get services.

@param Container $container A container instance