Skip to content

Commit

Permalink
Use simplexml_load_file where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomáš Votruba committed Jun 5, 2016
1 parent 2d3a4a8 commit 322fa24
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CodeSniffer.php
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ public function initStandard($standards, array $restrictions=array())
}

if (PHP_CODESNIFFER_VERBOSITY === 1) {
$ruleset = simplexml_load_string(file_get_contents($standard));
$ruleset = simplexml_load_file($standard);
if ($ruleset !== false) {
$standardName = (string) $ruleset['name'];
}
Expand Down Expand Up @@ -704,7 +704,7 @@ public function processRuleset($rulesetPath, $depth=0)
echo "Processing ruleset $rulesetPath".PHP_EOL;
}

$ruleset = simplexml_load_string(file_get_contents($rulesetPath));
$ruleset = simplexml_load_file($rulesetPath);
if ($ruleset === false) {
throw new PHP_CodeSniffer_Exception("Ruleset $rulesetPath is not valid");
}
Expand Down

0 comments on commit 322fa24

Please sign in to comment.