Commit 1b1fc31
committed
PHP 8.1 | PSR12/ConstantVisibility: allow for class constants to be
PHP 8.1 introduces the ability to declare class constants as `final`.
The tokenization of the `final` keyword in this context appears to be consistent PHPCS cross-version, so AFAICS no changes are needed to the PHP tokenizer.
However, the `PSR12.Properties.ConstantVisibility` sniff does need to allow for them.
Includes unit tests.
Ref: https://wiki.php.net/rfc/final_class_constfinal
1 parent 1cf73da commit 1b1fc31
File tree
3 files changed
+18
-2
lines changed- src/Standards/PSR12
- Sniffs/Properties
- Tests/Properties
3 files changed
+18
-2
lines changedLines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| |||
0 commit comments