original_string: 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;
      }
code: 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;
      }
code_tokens: 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 ; }
docstring: Adds a tag for this definition.
  
  @return $this
  
  @throws InvalidArgumentException when an invalid tag name or attribute is provided
docstring_tokens: Adds a tag for this definition .