original_string: protected function convertObjectToSimpleType($data)
      {
          /** @var null|TypeConverterInterface $converterClassName */
          $converterClassName = null;
          if (class_exists($this->buildConverterClassName(get_class($data)))) {
              $converterClassName = $this->buildConverterClassName(get_class($data));
          } else {
              $classInterfaces = class_implements($data);
              foreach ((array) $classInterfaces as $classInterface) {
                  if (class_exists($this->buildConverterClassName($classInterface))) {
                      $converterClassName = $this->buildConverterClassName($classInterface);
                      break;
                  }
              }
              if ($converterClassName === null) {
                  $classParents = class_parents($data);
                  foreach ((array) $classParents as $classParent) {
                      if (class_exists($this->buildConverterClassName($classParent))) {
                          $converterClassName = $this->buildConverterClassName($classParent);
                          break;
                      }
                  }
              }
          }
  
          if ($converterClassName === null) {
              throw new CmisRuntimeException(
                  'Could not find a converter that converts "' . get_class($data) . '" to a simple type.'
              );
          }
  
          return $converterClassName::convertToSimpleType($data);
      }
code: protected function convertObjectToSimpleType($data)
      {
          /** @var null|TypeConverterInterface $converterClassName */
          $converterClassName = null;
          if (class_exists($this->buildConverterClassName(get_class($data)))) {
              $converterClassName = $this->buildConverterClassName(get_class($data));
          } else {
              $classInterfaces = class_implements($data);
              foreach ((array) $classInterfaces as $classInterface) {
                  if (class_exists($this->buildConverterClassName($classInterface))) {
                      $converterClassName = $this->buildConverterClassName($classInterface);
                      break;
                  }
              }
              if ($converterClassName === null) {
                  $classParents = class_parents($data);
                  foreach ((array) $classParents as $classParent) {
                      if (class_exists($this->buildConverterClassName($classParent))) {
                          $converterClassName = $this->buildConverterClassName($classParent);
                          break;
                      }
                  }
              }
          }
  
          if ($converterClassName === null) {
              throw new CmisRuntimeException(
                  'Could not find a converter that converts "' . get_class($data) . '" to a simple type.'
              );
          }
  
          return $converterClassName::convertToSimpleType($data);
      }
code_tokens: protected function convertObjectToSimpleType ( $ data ) { /** @var null|TypeConverterInterface $converterClassName */ $ converterClassName = null ; if ( class_exists ( $ this -> buildConverterClassName ( get_class ( $ data ) ) ) ) { $ converterClassName = $ this -> buildConverterClassName ( get_class ( $ data ) ) ; } else { $ classInterfaces = class_implements ( $ data ) ; foreach ( ( array ) $ classInterfaces as $ classInterface ) { if ( class_exists ( $ this -> buildConverterClassName ( $ classInterface ) ) ) { $ converterClassName = $ this -> buildConverterClassName ( $ classInterface ) ; break ; } } if ( $ converterClassName === null ) { $ classParents = class_parents ( $ data ) ; foreach ( ( array ) $ classParents as $ classParent ) { if ( class_exists ( $ this -> buildConverterClassName ( $ classParent ) ) ) { $ converterClassName = $ this -> buildConverterClassName ( $ classParent ) ; break ; } } } } if ( $ converterClassName === null ) { throw new CmisRuntimeException ( 'Could not find a converter that converts "' . get_class ( $ data ) . '" to a simple type.' ) ; } return $ converterClassName :: convertToSimpleType ( $ data ) ; }
docstring: Convert an object to a simple type representation
  
  @param mixed $data
  @return mixed
  @throws CmisRuntimeException Exception is thrown if no type converter could be found to convert the given data
  to a simple type
docstring_tokens: Convert an object to a simple type representation