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

Breadcrumb

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

function YamlFileLoader::checkDefinition

1 call to YamlFileLoader::checkDefinition()
YamlFileLoader::parseDefinition in vendor/symfony/dependency-injection/Loader/YamlFileLoader.php

File

vendor/symfony/dependency-injection/Loader/YamlFileLoader.php, line 965

Class

YamlFileLoader
YamlFileLoader loads YAML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

private function checkDefinition(string $id, array $definition, string $file) : void {
    if ($this->isLoadingInstanceof) {
        $keywords = self::INSTANCEOF_KEYWORDS;
    }
    elseif (isset($definition['resource']) || isset($definition['namespace'])) {
        $keywords = self::PROTOTYPE_KEYWORDS;
    }
    else {
        $keywords = self::SERVICE_KEYWORDS;
    }
    foreach ($definition as $key => $value) {
        if (!isset($keywords[$key])) {
            throw new InvalidArgumentException(\sprintf('The configuration key "%s" is unsupported for definition "%s" in "%s". Allowed configuration keys are "%s".', $key, $id, $file, implode('", "', $keywords)));
        }
    }
}

API Navigation

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