Larabros\Elogram\Providers\GuzzleServiceProvider::register PHP Method

register() public method

Use the register method to register items with the container via the protected $this->container property or the getContainer method from the ContainerAwareTrait.
public register ( ) : void
return void
    public function register()
    {
        $container = $this->getContainer();
        $config = $container->get('config');
        $container->share(Client::class)->withArgument(new RawArgument(['base_uri' => $config->get('base_uri'), 'handler' => $container->get(HandlerStack::class)]));
        if ($config->get('http_adapter') === GuzzleAdapter::class) {
            $container->share(AdapterInterface::class, function () use($container) {
                return new GuzzleAdapter($container->get(Client::class));
            });
        }
        if ($config->get('http_adapter') === MockAdapter::class) {
            $path = realpath(__DIR__ . '/../../tests/fixtures') . '/';
            $container->share(AdapterInterface::class, new MockAdapter($path));
        }
    }
GuzzleServiceProvider