function YamlFileLoader::getClassesFromYaml
2 calls to YamlFileLoader::getClassesFromYaml()
- YamlFileLoader::getMappedClasses in vendor/
symfony/ serializer/ Mapping/ Loader/ YamlFileLoader.php - Return the names of the classes mapped in this file.
- YamlFileLoader::loadClassMetadata in vendor/
symfony/ serializer/ Mapping/ Loader/ YamlFileLoader.php
File
-
vendor/
symfony/ serializer/ Mapping/ Loader/ YamlFileLoader.php, line 153
Class
- YamlFileLoader
- YAML File Loader.
Namespace
Symfony\Component\Serializer\Mapping\LoaderCode
private function getClassesFromYaml() : array {
if (!stream_is_local($this->file)) {
throw new MappingException(\sprintf('This is not a local file "%s".', $this->file));
}
$this->yamlParser ??= new Parser();
$classes = $this->yamlParser
->parseFile($this->file, Yaml::PARSE_CONSTANT);
if (!$classes) {
return [];
}
if (!\is_array($classes)) {
throw new MappingException(\sprintf('The file "%s" must contain a YAML array.', $this->file));
}
return $classes;
}