Skip to content

Commit a978246

Browse files
committed
Revert "File::process(): don't apply include/exclude patterns to STDIN"
This reverts commit 0d79723.
1 parent 4dbf1d5 commit a978246

File tree

1 file changed

+30
-32
lines changed

1 file changed

+30
-32
lines changed

src/Files/File.php

Lines changed: 30 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -442,11 +442,30 @@ public function process()
442442
continue;
443443
}
444444

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) {
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+
$pattern = str_replace('/', '\\\\', $pattern);
454+
}
455+
456+
$pattern = '`'.$pattern.'`i';
457+
if (preg_match($pattern, $this->path) === 1) {
458+
$this->ignoredListeners[$class] = true;
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+
$included = false;
468+
foreach ($listenerData['include'] as $pattern) {
450469
// We assume a / directory separator, as do the exclude rules
451470
// most developers write, so we need a special case for any system
452471
// that is different.
@@ -456,36 +475,15 @@ public function process()
456475

457476
$pattern = '`'.$pattern.'`i';
458477
if (preg_match($pattern, $this->path) === 1) {
459-
$this->ignoredListeners[$class] = true;
460-
continue(2);
478+
$included = true;
479+
break;
461480
}
462481
}
463482

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-
$included = false;
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-
$pattern = str_replace('/', '\\\\', $pattern);
475-
}
476-
477-
$pattern = '`'.$pattern.'`i';
478-
if (preg_match($pattern, $this->path) === 1) {
479-
$included = true;
480-
break;
481-
}
482-
}
483-
484-
if ($included === false) {
485-
$this->ignoredListeners[$class] = true;
486-
continue;
487-
}
488-
}//end if
483+
if ($included === false) {
484+
$this->ignoredListeners[$class] = true;
485+
continue;
486+
}
489487
}//end if
490488

491489
$this->activeListener = $class;

0 commit comments

Comments
 (0)