original_string: public function buildFromConfigArray(array $config)
      {
          $cm = new CollectionManager();
          $collectionItemCollection = $cm->getCollectionItemCollection();
  
          foreach ($config as $collectionName => $attributes) {
              $path = $collectionName === 'pages' ? '' : $collectionName;
  
              if (is_array($attributes) === false) {
                  throw new \RuntimeException(sprintf('Expected array at the collection: "%s".', $collectionName));
              }
  
              $collectionItemCollection->set($collectionName, new Collection($collectionName, $path, $attributes));
          }
  
          return $cm;
      }
code: public function buildFromConfigArray(array $config)
      {
          $cm = new CollectionManager();
          $collectionItemCollection = $cm->getCollectionItemCollection();
  
          foreach ($config as $collectionName => $attributes) {
              $path = $collectionName === 'pages' ? '' : $collectionName;
  
              if (is_array($attributes) === false) {
                  throw new \RuntimeException(sprintf('Expected array at the collection: "%s".', $collectionName));
              }
  
              $collectionItemCollection->set($collectionName, new Collection($collectionName, $path, $attributes));
          }
  
          return $cm;
      }
code_tokens: public function buildFromConfigArray ( array $ config ) { $ cm = new CollectionManager ( ) ; $ collectionItemCollection = $ cm -> getCollectionItemCollection ( ) ; foreach ( $ config as $ collectionName => $ attributes ) { $ path = $ collectionName === 'pages' ? '' : $ collectionName ; if ( is_array ( $ attributes ) === false ) { throw new \ RuntimeException ( sprintf ( 'Expected array at the collection: "%s".' , $ collectionName ) ) ; } $ collectionItemCollection -> set ( $ collectionName , new Collection ( $ collectionName , $ path , $ attributes ) ) ; } return $ cm ; }
docstring: Build a collection manager with collections
  loaded from config array.
  
  A config array has the following sign:
  .Array
  (
  [collection_name_1] => Array
  (
  [attribute_1] => 'value'
  )
  
  [collection_name_2] => Array
  (
  )
  )
  
  @param array $config Configuration array with data about collections
  
  @return Yosymfony\Spress\Core\ContentManager\Collection\CollectionManager
  
  @throws RuntimeException If unexpected type of data
docstring_tokens: Build a collection manager with collections loaded from config array .