Skip to content

Commit dda854f

Browse files
committed
Fixed bug #1208 : Excluding files doesn't work when using STDIN with a filename specified
1 parent 535fc26 commit dda854f

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

package.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ http://pear.php.net/dtd/package-2.0.xsd">
3232
-- Makes it a lot easier to find and read the error message that was printed
3333
- Includes all changes from the 2.7.1 release
3434
- Fixed bug #1167 : 3.0.0RC1 PHAR does not work with PEAR standard
35+
- Fixed bug #1208 : Excluding files doesn't work when using STDIN with a filename specified
3536
</notes>
3637
<contents>
3738
<dir name="/">

src/Files/FileList.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,9 @@ public function __construct(Config $config, Ruleset $ruleset)
108108
*/
109109
public function addFile($path, $file=null)
110110
{
111-
// No filtering is done for STDIN.
112-
if ($path === 'STDIN'
113-
|| ($file !== null
114-
&& get_class($file) === 'PHP_CodeSniffer\Files\DummyFile')
115-
) {
111+
// No filtering is done for STDIN when the filename
112+
// has not been specified.
113+
if ($path === 'STDIN') {
116114
$this->files[$path] = $file;
117115
return;
118116
}

0 commit comments

Comments
 (0)