Пример #1
0
 /**
  * Processes an array of configurations.
  *
  * @param NodeInterface $configTree The node tree describing the configuration
  * @param array         $configs    An array of configuration items to process
  *
  * @return array The processed configuration
  */
 public function process(NodeInterface $configTree, array $configs)
 {
     $currentConfig = array();
     foreach ($configs as $config) {
         $config = $configTree->normalize($config);
         $currentConfig = $configTree->merge($currentConfig, $config);
     }
     return $configTree->finalize($currentConfig);
 }
Пример #2
0
 /**
  * Processes an array of configurations.
  *
  * @param NodeInterface $configTree The node tree describing the configuration
  * @param array         $configs    An array of configuration items to process
  * @param bool          $normalizeKeys Flag indicating if config key normalization is needed. True by default.
  *
  * @return array The processed configuration
  */
 public function process(NodeInterface $configTree, array $configs, $normalizeKeys = true)
 {
     if ($normalizeKeys) {
         $configs = self::normalizeKeys($configs);
     }
     $currentConfig = array();
     foreach ($configs as $config) {
         $config = $configTree->normalize($config);
         $currentConfig = $configTree->merge($currentConfig, $config);
     }
     return $configTree->finalize($currentConfig);
 }