Пример #1
0
 /**
  * SwiftMailerConfig constructor.
  *
  * @param IConfig $config
  */
 public function __construct(IConfig $config)
 {
     $this->config = $config;
     $config->ensure(self::TRANSPORTS, 'Missing array of available mailer transports.', 'array');
     foreach ($this->getTransports() as $name => $parameters) {
         $config->ensure(self::TRANSPORT($name), 'Missing an array with parameters for mailer transport.', 'array')->ensure(self::TRANSPORT_TYPE($name), 'Missing mailer transport type.');
     }
 }
Пример #2
0
 /**
  * TwigConfig constructor.
  *
  * @param IConfig $config
  */
 public function __construct(IConfig $config)
 {
     $this->config = $config;
     $config->ensure(self::DEBUG, 'Missing debug setting.');
     if ($config->has(self::PATHS)) {
         $config->ensure(self::PATHS, 'Missing a list of view directories.', 'array');
     }
     if ($config->has(self::NAMESPACES)) {
         $config->ensure(self::NAMESPACES, 'Missing a list of view namespaces.', 'array');
     }
 }
Пример #3
0
 /**
  * MonologConfig constructor.
  *
  * @param IConfig $config
  *
  * @throws InvalidConfigValueException
  */
 public function __construct(IConfig $config)
 {
     $this->config = $config;
     $config->ensure(self::LOG_CHANNELS, 'Missing a list of logging channels.')->ensure(self::DEFAULT_CHANNEL_NAME, 'Missing default channel name.');
     $channels = $this->getChannelConfigs();
     if (!is_array($channels)) {
         throw new InvalidConfigValueException(s('Config under the key "%s" must be an array.', self::LOG_CHANNELS));
     }
     foreach ($channels as $configName => $channelConfig) {
         $config->ensure(self::LOG_CHANNEL_FILE_PATH($configName), s('Missing log file path for logging channel "%s".', $configName));
         $config->ensure(self::LOG_CHANNEL_LOG_LEVEL($configName), s('Missing log file path for logging channel "%s".', $configName));
     }
     if ($this->getDefaultChannelConfig() === null) {
         throw new InvalidConfigValueException(s('Default channel with name "%s" does not exist.', $this->getDefaultChannelConfigName()));
     }
 }
 /**
  * MonologErrorHandlerConfig constructor.
  *
  * @param IConfig $config
  */
 public function __construct(IConfig $config)
 {
     $this->config = $config;
     $config->ensure(self::ERROR_CHANNEL_NAME, 'Missing name of the error channel.');
 }
 /**
  * BugsnagErrorHandlerConfig constructor.
  *
  * @param IConfig $config
  */
 public function __construct(IConfig $config)
 {
     $this->config = $config;
     $config->ensure(self::CLIENT_ID, 'Missing bugsnag client id.');
 }