Loads a YAML file.
string $file:
array The file content
protected function loadFile($file) {
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 YamlParser();
}
return $this
->validate($this->yamlParser
->parse(file_get_contents($file)), $file);
}