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));
    }
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));
    }
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 ) ) ; }
Fetch PHPCodeSniffer standard name from ruleset.xml.

@param string $ruleSetXmlPath The absolute path to ruleset.xml.

@return string The name of the PHPCodeSniffer standard.
Fetch PHPCodeSniffer standard name from ruleset . xml .