Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ private function __construct(array $thresholds = [], $regex = '', $verboseOutput
});
try {
foreach (file($ignoreFile) as $line => $pattern) {
if ('#' !== trim($line)[0] ?? '#') {
if ('#' !== (trim($pattern)[0] ?? '#')) {
preg_match($pattern, '');
$this->ignoreDeprecationPatterns[] = $pattern;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Test DeprecationErrorHandler with an ignoreFile
<?php
$filename = tempnam(sys_get_temp_dir(), 'sf-');
$ignorePatterns = [
'# A comment line and, below, an empty comment line and an empty line that should be interpreted as a comment.',
'#',
'',
'/^ignored .* deprecation/',
];
file_put_contents($filename, implode("\n", $ignorePatterns));
Expand Down