/**
  * @param string $file
  * @return array
  */
 protected function loadFile($file)
 {
     if (!class_exists('Symfony\\Component\\Yaml\\Parser')) {
         throw new \RuntimeException('Unable to load YAML config files as the Symfony Yaml Component is not installed.');
     }
     if (!stream_is_local($file)) {
         throw new \InvalidArgumentException(sprintf('This is not a local file "%s".', $file));
     }
     if (!file_exists($file)) {
         throw new \InvalidArgumentException(sprintf('The service file "%s" is not valid.', $file));
     }
     if (null === $this->yamlParser) {
         $this->yamlParser = new Parser();
     }
     try {
         $config = $this->yamlParser->parse(file_get_contents($file));
         if (!is_array($config)) {
             throw new \InvalidArgumentException(sprintf('The contents of the file "%s" is not an array.', $file));
         }
     } catch (ParseException $e) {
         throw new \InvalidArgumentException(sprintf('The file "%s" does not contain valid YAML.', $file), 0, $e);
     }
     $this->app->parseParameters($config);
     return $config;
 }