/**
  * @param $result
  * @param $value
  * @param $key
  *
  * @return mixed
  */
 public function merge(&$result, $value, $key)
 {
     if (is_array($value)) {
         foreach ($value as $item) {
             $this->itemMerge->merge($result, $item, $key);
         }
     } else {
         $this->itemMerge->merge($result, $value, $key);
     }
 }
Esempio n. 2
0
 /**
  * Attempt to merge assets, falling back to original non-merged ones, if merging fails
  *
  * @return void
  */
 protected function initialize()
 {
     if (!$this->isInitialized) {
         $this->isInitialized = true;
         try {
             $mergedAsset = $this->createMergedAsset($this->assets);
             $this->mergeStrategy->merge($this->assets, $mergedAsset);
             $this->assets = [$mergedAsset];
         } catch (\Exception $e) {
             $this->logger->critical($e);
         }
     }
 }