10000 bug #45921 [PhpUnitBridge] Fix ignoreFile comments (mondrake) · symfony/symfony@f97db87 · GitHub
[go: up one dir, main page]

Skip to content

Commit f97db87

Browse files
bug #45921 [PhpUnitBridge] Fix ignoreFile comments (mondrake)
This PR was squashed before being merged into the 6.1 branch. Discussion ---------- [PhpUnitBridge] Fix ignoreFile comments | Q | A | ------------- | --- | Branch? | 6.1 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #45918 | License | MIT Commits ------- 72c0846 [PhpUnitBridge] Fix ignoreFile comments
2 parents cfd44fb + 72c0846 commit f97db87

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Symfony/Bridge/PhpUnit/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
}

src/Symfony/Bridge/PhpUnit/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)
0