@@ -442,30 +442,11 @@ public function process()
442442                    continue ;
443443                }
444444
445-                 // If the file path matches one of our ignore patterns, skip it. 
446-                 // While there is support for a type of each pattern 
447-                 // (absolute or relative) we don't actually support it here. 
448-                 foreach  ($ listenerData'ignore ' ] as  $ pattern
449-                     // We assume a / directory separator, as do the exclude rules 
450-                     // most developers write, so we need a special case for any system 
451-                     // that is different. 
452-                     if  (DIRECTORY_SEPARATOR  === '\\' ) {
453-                         $ patternstr_replace ('/ ' , '\\\\' , $ pattern
454-                     }
455- 
456-                     $ pattern'` ' .$ pattern'`i ' ;
457-                     if  (preg_match ($ pattern$ this path ) === 1 ) {
458-                         $ this ignoredListeners [$ classtrue ;
459-                         continue (2 );
460-                     }
461-                 }
462- 
463-                 // If the file path does not match one of our include patterns, skip it. 
464-                 // While there is support for a type of each pattern 
465-                 // (absolute or relative) we don't actually support it here. 
466-                 if  (empty ($ listenerData'include ' ]) === false ) {
467-                     $ includedfalse ;
468-                     foreach  ($ listenerData'include ' ] as  $ pattern
445+                 if  (trim ($ this path , '\'" ' ) !== 'STDIN ' ) {
446+                     // If the file path matches one of our ignore patterns, skip it. 
447+                     // While there is support for a type of each pattern 
448+                     // (absolute or relative) we don't actually support it here. 
449+                     foreach  ($ listenerData'ignore ' ] as  $ pattern
469450                        // We assume a / directory separator, as do the exclude rules 
470451                        // most developers write, so we need a special case for any system 
471452                        // that is different. 
@@ -475,15 +456,36 @@ public function process()
475456
476457                        $ pattern'` ' .$ pattern'`i ' ;
477458                        if  (preg_match ($ pattern$ this path ) === 1 ) {
478-                             $ included true ;
479-                             break ;
459+                             $ this -> ignoredListeners [ $ class ]  = true ;
460+                             continue ( 2 ) ;
480461                        }
481462                    }
482463
483-                     if  ($ includedfalse ) {
484-                         $ this ignoredListeners [$ classtrue ;
485-                         continue ;
486-                     }
464+                     // If the file path does not match one of our include patterns, skip it. 
465+                     // While there is support for a type of each pattern 
466+                     // (absolute or relative) we don't actually support it here. 
467+                     if  (empty ($ listenerData'include ' ]) === false ) {
468+                         $ includedfalse ;
469+                         foreach  ($ listenerData'include ' ] as  $ pattern
470+                             // We assume a / directory separator, as do the exclude rules 
471+                             // most developers write, so we need a special case for any system 
472+                             // that is different. 
473+                             if  (DIRECTORY_SEPARATOR  === '\\' ) {
474+                                 $ patternstr_replace ('/ ' , '\\\\' , $ pattern
475+                             }
476+ 
477+                             $ pattern'` ' .$ pattern'`i ' ;
478+                             if  (preg_match ($ pattern$ this path ) === 1 ) {
479+                                 $ includedtrue ;
480+                                 break ;
481+                             }
482+                         }
483+ 
484+                         if  ($ includedfalse ) {
485+                             $ this ignoredListeners [$ classtrue ;
486+                             continue ;
487+                         }
488+                     }//end if 
487489                }//end if 
488490
489491                $ this activeListener  = $ class
@@ -965,59 +967,63 @@ protected function addMessage($error, $message, $line, $column, $code, $data, $s
965967
966968        // Make sure we are not ignoring this file. 
967969        $ includednull ;
968-         foreach  ($ checkCodesas  $ checkCode
969-             $ patternsnull ;
970- 
971-             if  (isset ($ this configCache ['includePatterns ' ][$ checkCodetrue ) {
972-                 $ patterns$ this configCache ['includePatterns ' ][$ checkCode
973-                 $ excludingfalse ;
974-             } else  if  (isset ($ this configCache ['ignorePatterns ' ][$ checkCodetrue ) {
975-                 $ patterns$ this configCache ['ignorePatterns ' ][$ checkCode
976-                 $ excludingtrue ;
977-             }
978- 
979-             if  ($ patternsnull ) {
980-                 continue ;
981-             }
970+         if  (trim ($ this path , '\'" ' ) === 'STDIN ' ) {
971+             $ includedtrue ;
972+         } else  {
973+             foreach  ($ checkCodesas  $ checkCode
974+                 $ patternsnull ;
975+ 
976+                 if  (isset ($ this configCache ['includePatterns ' ][$ checkCodetrue ) {
977+                     $ patterns$ this configCache ['includePatterns ' ][$ checkCode
978+                     $ excludingfalse ;
979+                 } else  if  (isset ($ this configCache ['ignorePatterns ' ][$ checkCodetrue ) {
980+                     $ patterns$ this configCache ['ignorePatterns ' ][$ checkCode
981+                     $ excludingtrue ;
982+                 }
982983
983-             foreach  ($ patternsas  $ pattern$ type
984-                 // While there is support for a type of each pattern 
985-                 // (absolute or relative) we don't actually support it here. 
986-                 $ replacements
987-                     '\\, '  => ', ' ,
988-                     '* '    => '.* ' ,
989-                 ];
990- 
991-                 // We assume a / directory separator, as do the exclude rules 
992-                 // most developers write, so we need a special case for any system 
993-                 // that is different. 
994-                 if  (DIRECTORY_SEPARATOR  === '\\' ) {
995-                     $ replacements'/ ' ] = '\\\\' ;
984+                 if  ($ patternsnull ) {
985+                     continue ;
996986                }
997987
998-                 $ pattern'` ' .strtr ($ pattern$ replacements'`i ' ;
999-                 $ matchedpreg_match ($ pattern$ this path );
988+                 foreach  ($ patternsas  $ pattern$ type
989+                     // While there is support for a type of each pattern 
990+                     // (absolute or relative) we don't actually support it here. 
991+                     $ replacements
992+                         '\\, '  => ', ' ,
993+                         '* '    => '.* ' ,
994+                     ];
1000995
1001-                 if  ($ matched0 ) {
1002-                     if  ($ excludingfalse  && $ includednull ) {
1003-                         // This file path is not being included. 
1004-                         $ includedfalse ;
996+                     // We assume a / directory separator, as do the exclude rules 
997+                     // most developers write, so we need a special case for any system 
998+                     // that is different. 
999+                     if  (DIRECTORY_SEPARATOR  === '\\' ) {
1000+                         $ replacements'/ ' ] = '\\\\' ;
10051001                    }
10061002
1007-                     continue ;
1008-                 } 
1003+                     $ pattern  =  ' ` ' . strtr ( $ pattern ,  $ replacements ). ' `i ' 
1004+                      $ matched  =  preg_match ( $ pattern ,  $ this -> path ); 
10091005
1010-                 if  ($ excluding true ) {
1011-                     // This file path is being excluded. 
1012-                     $ this -> ignoredCodes [ $ checkCode ] =  true ; 
1013-                     return  false ;
1014-                 }
1006+                      if  ($ matched 0 ) {
1007+                          if  ( $ excluding  ===  false  &&  $ included  ===  null ) { 
1008+                              // This file path is not being included. 
1009+                              $ included  =  false ;
1010+                          }
10151011
1016-                 // This file path is being included. 
1017-                 $ includedtrue ;
1018-                 break ;
1012+                         continue ;
1013+                     }
1014+ 
1015+                     if  ($ excludingtrue ) {
1016+                         // This file path is being excluded. 
1017+                         $ this ignoredCodes [$ checkCodetrue ;
1018+                         return  false ;
1019+                     }
1020+ 
1021+                     // This file path is being included. 
1022+                     $ includedtrue ;
1023+                     break ;
1024+                 }//end foreach 
10191025            }//end foreach 
1020-         }//end foreach  
1026+         }//end if  
10211027
10221028        if  ($ includedfalse ) {
10231029            // There were include rules set, but this file 
0 commit comments