original_string: protected function getNameFromRuleSet($ruleSetXmlPath)
      {
          try {
              $ruleSet = new \SimpleXMLElement(file_get_contents($ruleSetXmlPath));
              $name = trim($ruleSet->attributes()['name']);
              if ($name !== '') {
                  return $name;
              }
          } catch (\Exception $e) {
              // Nothing todo, use folder name.
          }
  
          return basename(dirname($ruleSetXmlPath));
      }
code: protected function getNameFromRuleSet($ruleSetXmlPath)
      {
          try {
              $ruleSet = new \SimpleXMLElement(file_get_contents($ruleSetXmlPath));
              $name = trim($ruleSet->attributes()['name']);
              if ($name !== '') {
                  return $name;
              }
          } catch (\Exception $e) {
              // Nothing todo, use folder name.
          }
  
          return basename(dirname($ruleSetXmlPath));
      }
code_tokens: protected function getNameFromRuleSet ( $ ruleSetXmlPath ) { try { $ ruleSet = new \ SimpleXMLElement ( file_get_contents ( $ ruleSetXmlPath ) ) ; $ name = trim ( $ ruleSet -> attributes ( ) [ 'name' ] ) ; if ( $ name !== '' ) { return $ name ; } } catch ( \ Exception $ e ) { // Nothing todo, use folder name. } return basename ( dirname ( $ ruleSetXmlPath ) ) ; }
docstring: Fetch PHPCodeSniffer standard name from ruleset.xml.
  
  @param string $ruleSetXmlPath The absolute path to ruleset.xml.
  
  @return string The name of the PHPCodeSniffer standard.
docstring_tokens: Fetch PHPCodeSniffer standard name from ruleset . xml .