vendor/payum/payum/src/Payum/Core/Bridge/Symfony/ContainerAwareCoreGatewayFactory.php line 35

Open in your IDE?
  1. <?php
  2. namespace Payum\Core\Bridge\Symfony;
  3. use Payum\Core\Bridge\Spl\ArrayObject;
  4. use Payum\Core\CoreGatewayFactory;
  5. use Symfony\Component\DependencyInjection\Container;
  6. use Symfony\Component\DependencyInjection\ContainerAwareInterface;
  7. use Symfony\Component\DependencyInjection\ContainerAwareTrait;
  8. use Symfony\Component\DependencyInjection\ContainerInterface;
  9. class ContainerAwareCoreGatewayFactory extends CoreGatewayFactory implements ContainerAwareInterface
  10. {
  11.     use ContainerAwareTrait;
  12.     /**
  13.      * @param ArrayObject $config
  14.      */
  15.     protected function buildClosures(ArrayObject $config)
  16.     {
  17.         foreach ($config as $name => $value) {
  18.             if (false == $value || false == is_string($value)) {
  19.                 continue;
  20.             }
  21.             $match = [];
  22.             if (preg_match('/^%(.*?)%$/'$value$match)) {
  23.                 $config[$name] = $value $this->container->getParameter($match[1]);
  24.             }
  25.             if ('@' === $value[0] && $this->container->has(substr($value1))) {
  26.                 $config[$name] = $value $this->container->get(substr($value1));
  27.             }
  28.         }
  29.         parent::buildClosures($config);
  30.     }
  31. }