@@ -239,7 +239,7 @@ public function __construct(Config $config)
239239 }
240240
241241 if ($ numSniffs === 0 ) {
242- throw new RuntimeException ('No sniffs were registered ' );
242+ throw new RuntimeException ('ERROR: No sniffs were registered ' );
243243 }
244244
245245 }//end __construct()
@@ -366,7 +366,7 @@ public function showSniffDeprecations()
366366
367367 $ messages = [];
368368 $ messageTemplate = 'This sniff has been deprecated since %s and will be removed in %s. %s ' ;
369- $ errorTemplate = 'The %s::%s() method must return a %sstring, received %s ' ;
369+ $ errorTemplate = 'ERROR: The %s::%s() method must return a %sstring, received %s ' ;
370370
371371 foreach ($ this ->deprecatedSniffs as $ sniffCode => $ className ) {
372372 if (isset ($ this ->sniffs [$ className ]) === false ) {
@@ -486,7 +486,7 @@ public function processRuleset($rulesetPath, $depth=0)
486486 libxml_use_internal_errors (true );
487487 $ ruleset = simplexml_load_string (file_get_contents ($ rulesetPath ));
488488 if ($ ruleset === false ) {
489- $ errorMsg = "Ruleset $ rulesetPath is not valid " .PHP_EOL ;
489+ $ errorMsg = "ERROR: Ruleset $ rulesetPath is not valid " .PHP_EOL ;
490490 $ errors = libxml_get_errors ();
491491 foreach ($ errors as $ error ) {
492492 $ errorMsg .= '- On line ' .$ error ->line .', column ' .$ error ->column .': ' .$ error ->message ;
@@ -530,7 +530,7 @@ public function processRuleset($rulesetPath, $depth=0)
530530 if ($ relativePath !== false && is_file ($ relativePath ) === true ) {
531531 $ autoloadPath = $ relativePath ;
532532 } else if (is_file ($ autoloadPath ) === false ) {
533- throw new RuntimeException ('The specified autoload file " ' .$ autoload .'" does not exist ' );
533+ throw new RuntimeException ('ERROR: The specified autoload file " ' .$ autoload .'" does not exist ' );
534534 }
535535
536536 include_once $ autoloadPath ;
@@ -993,7 +993,7 @@ private function expandRulesetReference($ref, $rulesetDir, $depth=0)
993993 }
994994 } else {
995995 if (is_file ($ ref ) === false ) {
996- $ error = "Referenced sniff \"$ ref \" does not exist " ;
996+ $ error = "ERROR: Referenced sniff \"$ ref \" does not exist " ;
997997 throw new RuntimeException ($ error );
998998 }
999999
@@ -1083,7 +1083,7 @@ private function processRule($rule, $newSniffs, $depth=0)
10831083
10841084 $ type = strtolower ((string ) $ rule ->type );
10851085 if ($ type !== 'error ' && $ type !== 'warning ' ) {
1086- throw new RuntimeException ("Message type \"$ type \" is invalid; must be \"error \" or \"warning \"" );
1086+ throw new RuntimeException ("ERROR: Message type \"$ type \" is invalid; must be \"error \" or \"warning \"" );
10871087 }
10881088
10891089 $ this ->ruleset [$ code ]['type ' ] = $ type ;
@@ -1412,7 +1412,7 @@ public function populateTokenListeners()
14121412
14131413 $ tokens = $ this ->sniffs [$ sniffClass ]->register ();
14141414 if (is_array ($ tokens ) === false ) {
1415- $ msg = "Sniff $ sniffClass register() method must return an array " ;
1415+ $ msg = "ERROR: Sniff $ sniffClass register() method must return an array " ;
14161416 throw new RuntimeException ($ msg );
14171417 }
14181418
@@ -1523,7 +1523,7 @@ public function setSniffProperty($sniffClass, $name, $settings)
15231523
15241524 if ($ isSettable === false ) {
15251525 if ($ settings ['scope ' ] === 'sniff ' ) {
1526- $ notice = "Ruleset invalid. Property \"$ propertyName \" does not exist on sniff " ;
1526+ $ notice = "ERROR: Ruleset invalid. Property \"$ propertyName \" does not exist on sniff " ;
15271527 $ notice .= array_search ($ sniffClass , $ this ->sniffCodes , true );
15281528 throw new RuntimeException ($ notice );
15291529 }
0 commit comments