original_string: public function addField($name, $attrs)
      {
          if (is_string($attrs)) {
              $attrs = ['type' => $attrs];
          }
          $attrs = array_intersect_key($attrs, $this->_fieldDefaults);
          $this->_fields[$name] = $attrs + $this->_fieldDefaults;
  
          return $this;
      }
code: public function addField($name, $attrs)
      {
          if (is_string($attrs)) {
              $attrs = ['type' => $attrs];
          }
          $attrs = array_intersect_key($attrs, $this->_fieldDefaults);
          $this->_fields[$name] = $attrs + $this->_fieldDefaults;
  
          return $this;
      }
code_tokens: public function addField ( $ name , $ attrs ) { if ( is_string ( $ attrs ) ) { $ attrs = [ 'type' => $ attrs ] ; } $ attrs = array_intersect_key ( $ attrs , $ this -> _fieldDefaults ) ; $ this -> _fields [ $ name ] = $ attrs + $ this -> _fieldDefaults ; return $ this ; }
docstring: Adds a field to the schema.
  
  @param string $name The field name.
  @param string|array $attrs The attributes for the field, or the type
  as a string.
  @return $this
docstring_tokens: Adds a field to the schema .