Commit f76ee80
committed
PHP 8.1: Generic/ConstructorName: fix deprecation notices
On PHP 8.1, passing `null` to `strtolower()` generates a `strtolower(): Passing null to parameter #1 ($string) of type string is deprecated` notice.
The `File::getDeclarationName()` will return `null` for anonymous classes, so we need an extra safeguard here.
This fix is covered by the existing unit tests and was exposed when running the tests on PHP 8.1 with `error_reporting` set to `E_ALL`.1 parent 3964931 commit f76ee80
File tree
1 file changed
+6
-1
lines changed- src/Standards/Generic/Sniffs/NamingConventions
1 file changed
+6
-1
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
| |||
0 commit comments