Skip to content

feat(baseline): can ignore deprecations with regex #6287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nikophil
Copy link
Contributor

@nikophil nikophil commented Aug 2, 2025

I think it could be nice to be able to ignore deprecations using regex: see for instance doctrine/deprecations: they do insert the line number in their deprecation messages. Meaning that if they change some code in the file, if PHPUnit is not able to ignore deprecations based on regex, the code would break

@@ -112,7 +113,7 @@ public function equals(self $other): bool
return $this->file() === $other->file() &&
$this->line() === $other->line() &&
$this->hash() === $other->hash() &&
$this->description() === $other->description();
($this->description() === $other->description() || preg_match('{' . $this->description() . '}', $other->description) !== false);
Copy link
Contributor Author

@nikophil nikophil Aug 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm actually wondering if we should use regex, or a simple str_contains(), WDYT? maybe both?

@sebastianbergmann sebastianbergmann added the type/enhancement A new idea that should be implemented label Aug 3, 2025
@sebastianbergmann
Copy link
Owner

This pull request proposes a new feature and should therefore target the main branch.

@nikophil nikophil changed the base branch from 12.3 to main August 3, 2025 06:39
@nikophil nikophil force-pushed the feat/baseline-with-regex branch from 8b00bab to 3ef5f62 Compare August 3, 2025 06:40
@nikophil nikophil force-pushed the feat/baseline-with-regex branch from 3ef5f62 to 35d4338 Compare August 3, 2025 06:42
@nikophil
Copy link
Contributor Author

nikophil commented Aug 3, 2025

@sebastianbergmann done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A new idea that should be implemented
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants