Commit 470c361
committed
New reusable workflow: "find token properties"
PHP_CodeSniffer originally offered a number of "token groups" as static properties in the `Tokens` class to allow re-use of these groups across sniffs.
As of PHP_CodeSniffer 4.0.0, these static properties still exist, but are now (soft) deprecated in favour of class constants in the `Tokens` class for the same, which should create more stability, as this means the token groups can no longer be changed from within a(n external) sniff.
PHP_CodeSniffer related projects which still support both PHPCS 3.x as well as 4.x, will, for the time being, still need to use the static properties from the `Tokens` class.
Once a PHP_CodeSniffer related project has dropped support for PHPCS 3.x though, they can enforce the use of the class constants from the `Tokens` class by running this re-usable workflow in their CI.
* This workflow is particularly useful for repositories which have existing open PRs at the time of the PHPCS version drop and these open PRs should not re-introduce references to the static properties.
* This workflow can also be helpful for repositories which have contributors which contribute to a range of PHPCS related repos and for whom it would be very easy to overlook that they've used the "old-school" token group instead of the new-fangled token group constants.
In contrast to most of the other reusable workflows, this workflow does not work based on a configuration file.
One should only add a job calling this workflow to a project's CI once support for PHPCS 3.x has been dropped.
Includes adding documentation about this workflow to the `README` file.1 parent 545ea21 commit 470c361
2 files changed
+41
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
70 | 73 | | |
71 | 74 | | |
72 | 75 | | |
73 | | - | |
| 76 | + | |
74 | 77 | | |
75 | | - | |
76 | | - | |
| 78 | + | |
| 79 | + | |
77 | 80 | | |
78 | | - | |
79 | | - | |
| 81 | + | |
| 82 | + | |
80 | 83 | | |
81 | | - | |
82 | | - | |
| 84 | + | |
| 85 | + | |
83 | 86 | | |
84 | | - | |
85 | | - | |
86 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
0 commit comments