original_string: private function addProperty(ClassType $class, Field $field)
      {
          $property = $class->addProperty($field->getFieldName());
          $property->setVisibility('protected');
          if (!empty($field->getDescription())) {
              $property->setComment($field->getDescription());
              $property->addComment('');
          }
          $dataType = $this->getPhpDataType($field);
          $property->addComment('@var '.$dataType);
          if ($this->isCollectionType($dataType)) {
              $property->setValue([]);
          }
      }
code: private function addProperty(ClassType $class, Field $field)
      {
          $property = $class->addProperty($field->getFieldName());
          $property->setVisibility('protected');
          if (!empty($field->getDescription())) {
              $property->setComment($field->getDescription());
              $property->addComment('');
          }
          $dataType = $this->getPhpDataType($field);
          $property->addComment('@var '.$dataType);
          if ($this->isCollectionType($dataType)) {
              $property->setValue([]);
          }
      }
code_tokens: private function addProperty ( ClassType $ class , Field $ field ) { $ property = $ class -> addProperty ( $ field -> getFieldName ( ) ) ; $ property -> setVisibility ( 'protected' ) ; if ( ! empty ( $ field -> getDescription ( ) ) ) { $ property -> setComment ( $ field -> getDescription ( ) ) ; $ property -> addComment ( '' ) ; } $ dataType = $ this -> getPhpDataType ( $ field ) ; $ property -> addComment ( '@var ' . $ dataType ) ; if ( $ this -> isCollectionType ( $ dataType ) ) { $ property -> setValue ( [ ] ) ; } }
docstring: Add a property to a class.
  
  @param ClassType $class
  @param Field     $field
docstring_tokens: Add a property to a class .