Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. YamlFileLoader.php

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\Loader

Code

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal