public function load($file, $type = null) { $path = $this->locator->locate($file); $data = $this->loadFile($path); // empty file if ($data === null) { $data = array(); } // not an array if (!is_array($data)) { throw new \InvalidArgumentException(sprintf('The file "%s" must contain a YAML array.', $file)); } $config = new Config($data); $config->addResource(new FileResource($path)); // imports $this->parseImports($config, $path); return $config; }