original_string: public static function convertSumupObjectToArray($object)
      {
          $results = [];
          foreach ($object->_keys as $property) {
              $v = $object->{$property};
              if ($v instanceof SumupObject) {
                  $results[$property] = $v->__toArray();
              } elseif (is_array($v)) {
                  $results[$property] = self::convertSumupObjectToArray($v);
              } else {
                  $results[$property] = $v;
              }
          }
          return $results;
      }
code: public static function convertSumupObjectToArray($object)
      {
          $results = [];
          foreach ($object->_keys as $property) {
              $v = $object->{$property};
              if ($v instanceof SumupObject) {
                  $results[$property] = $v->__toArray();
              } elseif (is_array($v)) {
                  $results[$property] = self::convertSumupObjectToArray($v);
              } else {
                  $results[$property] = $v;
              }
          }
          return $results;
      }
code_tokens: public static function convertSumupObjectToArray ( $ object ) { $ results = [ ] ; foreach ( $ object -> _keys as $ property ) { $ v = $ object -> { $ property } ; if ( $ v instanceof SumupObject ) { $ results [ $ property ] = $ v -> __toArray ( ) ; } elseif ( is_array ( $ v ) ) { $ results [ $ property ] = self :: convertSumupObjectToArray ( $ v ) ; } else { $ results [ $ property ] = $ v ; } } return $ results ; }
docstring: Recursively converts the PHP Sumup object to an array.
  
  @param array $values The PHP Sumup object to convert.
  @return array
docstring_tokens: Recursively converts the PHP Sumup object to an array .