Skip to content

Commit 8bb5e4b

Browse files
mondrakenicolas-grekas
authored andcommitted
[PhpUnitBridge] Fix ignoreFile comments
1 parent 951031e commit 8bb5e4b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

DeprecationErrorHandler/Configuration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
125125
});
126126
try {
127127
foreach (file($ignoreFile) as $line => $pattern) {
128-
if ('#' !== trim($line)[0] ?? '#') {
128+
if ('#' !== (trim($pattern)[0] ?? '#')) {
129129
preg_match($pattern, '');
130130
$this->ignoreDeprecationPatterns[] = $pattern;
131131
}

Tests/DeprecationErrorHandler/ignore.phpt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ Test DeprecationErrorHandler with an ignoreFile
44
<?php
55
$filename = tempnam(sys_get_temp_dir(), 'sf-');
66
$ignorePatterns = [
7+
'# A comment line and, below, an empty comment line and an empty line that should be interpreted as a comment.',
8+
'#',
9+
'',
710
'/^ignored .* deprecation/',
811
];
912
file_put_contents($filename, implode("\n", $ignorePatterns));

0 commit comments

Comments
 (0)