Ignoring an error by matching its message couples the configuration to wording that changes between releases.
parameters:
ignoreErrors:
# brittle: the wording changed in 1.2
- '#Cannot call method [a-zA-Z]+() on mixed#'
# better: scoped to one path, and reported when unused
-
message: '#no value type specified in iterable type#'
path: src/Legacy/Importer.php
count: 3
reportUnmatchedIgnoredErrors: true
reportUnmatchedIgnoredErrors is on by default and worth keeping on, because it turns an obsolete ignore into a build failure rather than a silent hole. A count means fixing two of three occurrences also fails the build, which is the right kind of annoying. A baseline is better than hand-written ignores for existing debt; ignores are for the handful of cases that are genuinely correct and unprovable.