@@ -346,7 +346,6 @@ public function process()
346346 $ listenerIgnoreTo = [];
347347 $ inTests = defined ('PHP_CODESNIFFER_IN_TESTS ' );
348348 $ checkAnnotations = $ this ->config ->annotations ;
349- $ annotationErrors = [];
350349
351350 // Foreach of the listeners that have registered to listen for this
352351 // token, get them to process it.
@@ -415,15 +414,7 @@ public function process()
415414 'scope ' => 'sniff ' ,
416415 ];
417416 $ listenerClass = $ this ->ruleset ->sniffCodes [$ listenerCode ];
418- try {
419- $ this ->ruleset ->setSniffProperty ($ listenerClass , $ propertyCode , $ settings );
420- } catch (RuntimeException $ e ) {
421- // Non-existant property being set via an inline annotation.
422- // This is typically a PHPCS test case file, but we can't throw an error on the annotation
423- // line as it would get ignored. We also don't want this error to block
424- // the scan of the current file, so collect these and throw later.
425- $ annotationErrors [] = 'Line ' .$ token ['line ' ].': ' .str_replace ('Ruleset invalid. ' , '' , $ e ->getMessage ());
426- }
417+ $ this ->ruleset ->setSniffProperty ($ listenerClass , $ propertyCode , $ settings );
427418 }
428419 }
429420 }//end if
@@ -553,13 +544,6 @@ public function process()
553544 }
554545 }
555546
556- if ($ annotationErrors !== []) {
557- $ error = 'Encountered invalid inline phpcs:set annotations. Found: ' .PHP_EOL ;
558- $ error .= implode (PHP_EOL , $ annotationErrors );
559-
560- $ this ->addWarning ($ error , null , 'Internal.PropertyDoesNotExist ' );
561- }
562-
563547 if (PHP_CODESNIFFER_VERBOSITY > 2 ) {
564548 echo "\t*** END TOKEN PROCESSING *** " .PHP_EOL ;
565549 echo "\t*** START SNIFF PROCESSING REPORT *** " .PHP_EOL ;
0 commit comments