/**
  * @param \Spryker\Yves\Kernel\Container $container
  *
  * @return \Spryker\Yves\Kernel\Container
  */
 public function provideDependencies(Container $container)
 {
     $container[self::CLIENT_PAYOLUTION] = function (Container $container) {
         return $container->getLocator()->payolution()->client();
     };
     return $container;
 }
 /**
  * @param \Spryker\Yves\Kernel\Container $container
  *
  * @return \Spryker\Yves\Kernel\Container
  */
 protected function provideClients(Container $container)
 {
     $container[self::CLIENT_CART] = function () use($container) {
         return $container->getLocator()->cart()->client();
     };
     return $container;
 }
Example #3
0
 /**
  * @param string $key
  *
  * @throws \Spryker\Yves\Kernel\Exception\Container\ContainerKeyNotFoundException
  *
  * @return mixed
  */
 protected function getProvidedDependency($key)
 {
     if ($this->container === null) {
         $this->container = $this->createContainerWithProvidedDependencies();
     }
     if ($this->container->offsetExists($key) === false) {
         throw new ContainerKeyNotFoundException($this, $key);
     }
     return $this->container[$key];
 }
Example #4
0
 /**
  * @return void
  */
 public function testGetLocatorShouldReturnInstanceOfLocator()
 {
     $container = new Container();
     $this->assertInstanceOf(LocatorLocatorInterface::class, $container->getLocator());
 }