function CheckDefinitionValidityPass::validateAttributes
1 call to CheckDefinitionValidityPass::validateAttributes()
- CheckDefinitionValidityPass::process in vendor/
symfony/ dependency-injection/ Compiler/ CheckDefinitionValidityPass.php - Processes the ContainerBuilder to validate the Definition.
File
-
vendor/
symfony/ dependency-injection/ Compiler/ CheckDefinitionValidityPass.php, line 87
Class
- CheckDefinitionValidityPass
- This pass validates each definition individually only taking the information into account which is contained in the definition itself.
Namespace
Symfony\Component\DependencyInjection\CompilerCode
private function validateAttributes(string $id, string $tag, array $attributes, array $path = []) : void {
foreach ($attributes as $name => $value) {
if (\is_array($value)) {
$this->validateAttributes($id, $tag, $value, [
$path,
$name,
]);
}
elseif (!\is_scalar($value) && null !== $value) {
$name = implode('.', [
$path,
$name,
]);
throw new RuntimeException(\sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $id, $tag, $name));
}
}
}