vendor/uvdesk/mailbox-component/DependencyInjection/UVDeskExtension.php line 17

Open in your IDE?
  1. <?php
  2. namespace Webkul\UVDesk\MailboxBundle\DependencyInjection;
  3. use Symfony\Component\Config\FileLocator;
  4. use Symfony\Component\DependencyInjection\ContainerBuilder;
  5. use Symfony\Component\HttpKernel\DependencyInjection\Extension;
  6. use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
  7. class UVDeskExtension extends Extension
  8. {
  9.     public function getAlias()
  10.     {
  11.         return 'uvdesk_mailbox';
  12.     }
  13.     public function getConfiguration(array $configsContainerBuilder $container)
  14.     {
  15.         return new Configuration();
  16.     }
  17.     public function load(array $configsContainerBuilder $container)
  18.     {
  19.         $loader = new YamlFileLoader($container, new FileLocator(__DIR__ '/../Resources/config'));
  20.         $loader->load('services.yaml');
  21.         // Load bundle configurations
  22.         $configuration $this->getConfiguration($configs$container);
  23.         foreach ($this->processConfiguration($configuration$configs) as $param => $value) {
  24.             switch ($param) {
  25.                 case 'emails':
  26.                     foreach ($value as $field => $fieldValue) {
  27.                         $container->setParameter("uvdesk.emails.$field"$fieldValue);
  28.                     }
  29.                     break;
  30.                 case 'default_mailbox':
  31.                     $container->setParameter("uvdesk.default_mailbox"$value);
  32.                     break;
  33.                 case 'mailboxes':
  34.                     $container->setParameter("uvdesk.mailboxes"array_keys($value));
  35.                     foreach ($value as $mailboxId => $mailboxDetails) {
  36.                         $container->setParameter("uvdesk.mailboxes.$mailboxId"$mailboxDetails);
  37.                     }
  38.                     break;
  39.                 default:
  40.                     break;
  41.             }
  42.         }
  43.     }
  44. }