final public function tag(string $name, array $attributes = [])
    {
        if ('' === $name) {
            throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
        }

        foreach ($attributes as $attribute => $value) {
            if (null !== $value && !is_scalar($value)) {
                throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.', $name, $attribute));
            }
        }

        $this->definition->addTag($name, $attributes);

        return $this;
    }
final public function tag(string $name, array $attributes = [])
    {
        if ('' === $name) {
            throw new InvalidArgumentException('The tag name in "_defaults" must be a non-empty string.');
        }

        foreach ($attributes as $attribute => $value) {
            if (null !== $value && !is_scalar($value)) {
                throw new InvalidArgumentException(sprintf('Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.', $name, $attribute));
            }
        }

        $this->definition->addTag($name, $attributes);

        return $this;
    }
final public function tag ( string $ name , array $ attributes = [ ] ) { if ( '' === $ name ) { throw new InvalidArgumentException ( 'The tag name in "_defaults" must be a non-empty string.' ) ; } foreach ( $ attributes as $ attribute => $ value ) { if ( null !== $ value && ! is_scalar ( $ value ) ) { throw new InvalidArgumentException ( sprintf ( 'Tag "%s", attribute "%s" in "_defaults" must be of a scalar-type.' , $ name , $ attribute ) ) ; } } $ this -> definition -> addTag ( $ name , $ attributes ) ; return $ this ; }
Adds a tag for this definition.

@return $this

@throws InvalidArgumentException when an invalid tag name or attribute is provided
Adds a tag for this definition .