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

Breadcrumb

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

function YamlFileLoader::validateAttributes

2 calls to YamlFileLoader::validateAttributes()
YamlFileLoader::parseDefaults in vendor/symfony/dependency-injection/Loader/YamlFileLoader.php
YamlFileLoader::parseDefinition in vendor/symfony/dependency-injection/Loader/YamlFileLoader.php

File

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

Class

YamlFileLoader
YamlFileLoader loads YAML files service definitions.

Namespace

Symfony\Component\DependencyInjection\Loader

Code

private function validateAttributes(string $message, array $attributes, array $path = []) : void {
    foreach ($attributes as $name => $value) {
        if (\is_array($value)) {
            $this->validateAttributes($message, $value, [
                $path,
                $name,
            ]);
        }
        elseif (!\is_scalar($value ?? '')) {
            $name = implode('.', [
                $path,
                $name,
            ]);
            throw new InvalidArgumentException(\sprintf($message, $name));
        }
    }
}

API Navigation

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