@@ -239,7 +239,7 @@ public function __construct(Config $config)
239
239
}
240
240
241
241
if ($ numSniffs === 0 ) {
242
- throw new RuntimeException ('No sniffs were registered ' );
242
+ throw new RuntimeException ('ERROR: No sniffs were registered ' );
243
243
}
244
244
245
245
}//end __construct()
@@ -366,7 +366,7 @@ public function showSniffDeprecations()
366
366
367
367
$ messages = [];
368
368
$ 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 ' ;
370
370
371
371
foreach ($ this ->deprecatedSniffs as $ sniffCode => $ className ) {
372
372
if (isset ($ this ->sniffs [$ className ]) === false ) {
@@ -486,7 +486,7 @@ public function processRuleset($rulesetPath, $depth=0)
486
486
libxml_use_internal_errors (true );
487
487
$ ruleset = simplexml_load_string (file_get_contents ($ rulesetPath ));
488
488
if ($ ruleset === false ) {
489
- $ errorMsg = "Ruleset $ rulesetPath is not valid " .PHP_EOL ;
489
+ $ errorMsg = "ERROR: Ruleset $ rulesetPath is not valid " .PHP_EOL ;
490
490
$ errors = libxml_get_errors ();
491
491
foreach ($ errors as $ error ) {
492
492
$ errorMsg .= '- On line ' .$ error ->line .', column ' .$ error ->column .': ' .$ error ->message ;
@@ -530,7 +530,7 @@ public function processRuleset($rulesetPath, $depth=0)
530
530
if ($ relativePath !== false && is_file ($ relativePath ) === true ) {
531
531
$ autoloadPath = $ relativePath ;
532
532
} 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 ' );
534
534
}
535
535
536
536
include_once $ autoloadPath ;
@@ -993,7 +993,7 @@ private function expandRulesetReference($ref, $rulesetDir, $depth=0)
993
993
}
994
994
} else {
995
995
if (is_file ($ ref ) === false ) {
996
- $ error = "Referenced sniff \"$ ref \" does not exist " ;
996
+ $ error = "ERROR: Referenced sniff \"$ ref \" does not exist " ;
997
997
throw new RuntimeException ($ error );
998
998
}
999
999
@@ -1083,7 +1083,7 @@ private function processRule($rule, $newSniffs, $depth=0)
1083
1083
1084
1084
$ type = strtolower ((string ) $ rule ->type );
1085
1085
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 \"" );
1087
1087
}
1088
1088
1089
1089
$ this ->ruleset [$ code ]['type ' ] = $ type ;
@@ -1412,7 +1412,7 @@ public function populateTokenListeners()
1412
1412
1413
1413
$ tokens = $ this ->sniffs [$ sniffClass ]->register ();
1414
1414
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 " ;
1416
1416
throw new RuntimeException ($ msg );
1417
1417
}
1418
1418
@@ -1523,7 +1523,7 @@ public function setSniffProperty($sniffClass, $name, $settings)
1523
1523
1524
1524
if ($ isSettable === false ) {
1525
1525
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 " ;
1527
1527
$ notice .= array_search ($ sniffClass , $ this ->sniffCodes , true );
1528
1528
throw new RuntimeException ($ notice );
1529
1529
}
0 commit comments