original_string: public function getId()
      {
          $id = $this->props['attribs']['id'];
          $sepChar = '_'; // character to join prefix and id
          $repChar = '_'; // replace \W with this char
          if (!$id && $this->props['attribs']['name']) {
              $id = \preg_replace('/\W/', $repChar, $this->props['attribs']['name']);
              $id = \preg_replace('/'.$repChar.'+/', $repChar, $id);
              $id = \trim($id, $repChar);
              if ($id && $this->props['idPrefix']) {
                  $prefix = $this->props['idPrefix'];
                  if (\preg_match('/[a-z]$/i', $prefix)) {
                      $prefix = $prefix.$sepChar;
                  }
                  $id = $prefix.$id;
              }
              if ($id) {
                  $this->props['attribs']['id'] = $id;
              }
          }
          return $id;
      }
code: public function getId()
      {
          $id = $this->props['attribs']['id'];
          $sepChar = '_'; // character to join prefix and id
          $repChar = '_'; // replace \W with this char
          if (!$id && $this->props['attribs']['name']) {
              $id = \preg_replace('/\W/', $repChar, $this->props['attribs']['name']);
              $id = \preg_replace('/'.$repChar.'+/', $repChar, $id);
              $id = \trim($id, $repChar);
              if ($id && $this->props['idPrefix']) {
                  $prefix = $this->props['idPrefix'];
                  if (\preg_match('/[a-z]$/i', $prefix)) {
                      $prefix = $prefix.$sepChar;
                  }
                  $id = $prefix.$id;
              }
              if ($id) {
                  $this->props['attribs']['id'] = $id;
              }
          }
          return $id;
      }
code_tokens: public function getId ( ) { $ id = $ this -> props [ 'attribs' ] [ 'id' ] ; $ sepChar = '_' ; // character to join prefix and id $ repChar = '_' ; // replace \W with this char if ( ! $ id && $ this -> props [ 'attribs' ] [ 'name' ] ) { $ id = \ preg_replace ( '/\W/' , $ repChar , $ this -> props [ 'attribs' ] [ 'name' ] ) ; $ id = \ preg_replace ( '/' . $ repChar . '+/' , $ repChar , $ id ) ; $ id = \ trim ( $ id , $ repChar ) ; if ( $ id && $ this -> props [ 'idPrefix' ] ) { $ prefix = $ this -> props [ 'idPrefix' ] ; if ( \ preg_match ( '/[a-z]$/i' , $ prefix ) ) { $ prefix = $ prefix . $ sepChar ; } $ id = $ prefix . $ id ; } if ( $ id ) { $ this -> props [ 'attribs' ] [ 'id' ] = $ id ; } } return $ id ; }
docstring: Returns ID attribute
  If ID attribute is non-existant, ID will be derived from name and prefix
  
  @return string|null
docstring_tokens: Returns ID attribute If ID attribute is non - existant ID will be derived from name and prefix