Commit ecc23f3
committed
PHP 8.2 | PSR12/NullableTypeDeclaration: allow for nullable true/false
As of PHP 8.2, `true`, `false` and `null` will be allowed as stand-alone types.
The `true` and the `false` types are allowed to be nullable, the `null` type is not (but that's not the concern of the sniff).
Also see: https://3v4l.org/ZpfID
This adjusts the sniff to take these new types into account.
Includes unit tests.
Refs:
* https://wiki.php.net/rfc/null-false-standalone-types
* https://wiki.php.net/rfc/true-type1 parent b7c3778 commit ecc23f3
File tree
4 files changed
+21
-0
lines changed- src/Standards/PSR12
- Sniffs/Functions
- Tests/Functions
4 files changed
+21
-0
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
0 commit comments