original_string: public function convertExtension(array $data = null, array $cmisKeys = [])
      {
          $extensions = [];
  
          foreach (array_diff_key((array) $data, array_flip($cmisKeys)) as $key => $value) {
  
              if (!is_array($value)) {
                  $value = (empty($value)) ? null : (string) $value;
                  $extensions[] = new CmisExtensionElement(null, $key, [], $value);
              } else {
                  $extension = $this->convertExtension($value, $cmisKeys);
  
                  if (!empty($extension)) {
                      $extensions[] = new CmisExtensionElement(
                          null,
                          $key,
                          [],
                          null,
                          $extension
                      );
                  }
              }
          }
  
          return $extensions;
      }
code: public function convertExtension(array $data = null, array $cmisKeys = [])
      {
          $extensions = [];
  
          foreach (array_diff_key((array) $data, array_flip($cmisKeys)) as $key => $value) {
  
              if (!is_array($value)) {
                  $value = (empty($value)) ? null : (string) $value;
                  $extensions[] = new CmisExtensionElement(null, $key, [], $value);
              } else {
                  $extension = $this->convertExtension($value, $cmisKeys);
  
                  if (!empty($extension)) {
                      $extensions[] = new CmisExtensionElement(
                          null,
                          $key,
                          [],
                          null,
                          $extension
                      );
                  }
              }
          }
  
          return $extensions;
      }
code_tokens: public function convertExtension ( array $ data = null , array $ cmisKeys = [ ] ) { $ extensions = [ ] ; foreach ( array_diff_key ( ( array ) $ data , array_flip ( $ cmisKeys ) ) as $ key => $ value ) { if ( ! is_array ( $ value ) ) { $ value = ( empty ( $ value ) ) ? null : ( string ) $ value ; $ extensions [ ] = new CmisExtensionElement ( null , $ key , [ ] , $ value ) ; } else { $ extension = $ this -> convertExtension ( $ value , $ cmisKeys ) ; if ( ! empty ( $ extension ) ) { $ extensions [ ] = new CmisExtensionElement ( null , $ key , [ ] , null , $ extension ) ; } } } return $ extensions ; }
docstring: Convert given input data to an Extension object
  
  @param array|null $data
  @param string[] $cmisKeys
  @return CmisExtensionElement[]
docstring_tokens: Convert given input data to an Extension object