lint/style/prefer-str-contains
In the modernize set. Unsafe fix: it can change behaviour.
What it does
Replace strpos() and stripos() calls with str_starts_with() or str_contains() if possible.
Configuration
[lint.rules]
"style/prefer-str-contains" = "error"
To skip it in some files, add an override or a @pun-ignore-file comment.
Options
| Name | Type | Allowed values | Default | Upstream name |
|---|---|---|---|---|
modernize-stripos |
bool |
Any | false |
modernize_stripos |
Replaces
modernize_strpos(php-cs-fixer, risky)str-contains(mago-linter)str-starts-with(mago-linter)