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

Breadcrumb

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

function DefaultsConfigurator::validateAttributes

1 call to DefaultsConfigurator::validateAttributes()
DefaultsConfigurator::tag in vendor/symfony/dependency-injection/Loader/Configurator/DefaultsConfigurator.php
Adds a tag for this definition.

File

vendor/symfony/dependency-injection/Loader/Configurator/DefaultsConfigurator.php, line 65

Class

DefaultsConfigurator
@author Nicolas Grekas <p@tchwork.com>

Namespace

Symfony\Component\DependencyInjection\Loader\Configurator

Code

private function validateAttributes(string $tag, array $attributes, array $path = []) : void {
    foreach ($attributes as $name => $value) {
        if (\is_array($value)) {
            $this->validateAttributes($tag, $value, [
                $path,
                $name,
            ]);
        }
        elseif (!\is_scalar($value ?? '')) {
            $name = implode('.', [
                $path,
                $name,
            ]);
            throw new InvalidArgumentException(\sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type or an array of scalar-type.', $tag, $name));
        }
    }
}

API Navigation

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