/**
  * @return string
  */
 private function keyPrefix()
 {
     if (empty($this->prefix)) {
         return '';
     }
     return $this->prefix . $this->config->getSeparator();
 }
 public function addApplicationConfig(ApplicationConfig $config, $prefix = 'config')
 {
     Assertion::string($prefix);
     if (!empty($prefix)) {
         $prefix .= $config->getSeparator();
     }
     foreach ($config as $key => $value) {
         $this->container[$prefix . $key] = $value;
     }
 }
 public function testItThrowsForAnEmptySeparatorWhenSettingSeparator()
 {
     $this->expectException(InvalidArgumentException::class);
     $this->config = new ApplicationConfig([]);
     $this->config->setSeparator('');
 }
 /**
  * @param ApplicationConfig $config
  */
 public function __construct(ApplicationConfig $config)
 {
     parent::__construct(new RecursiveArrayIterator($config->asArray()), RecursiveIteratorIterator::SELF_FIRST);
     $this->separator = $config->getSeparator();
 }
 /**
  * @param string $filename
  *
  * @return void
  */
 private function readFileAndMergeConfig($filename)
 {
     $reader = $this->getReaderFor($filename);
     $this->config->merge($reader->read($filename));
 }