@@ -52,26 +52,22 @@ See CS sniffer docs for details, but in general using `severity` of `0` can sile
52
52
```
53
53
54
54
### Excluding certain sniffs
55
- You can also completely exclude certain sniffs, e.g. if you are on a PHP 8+ project and
56
- want to use all the new language features:
55
+ You can also completely exclude certain sniffs:
57
56
``` xml
58
57
<rule ref =" vendor/php-collective/code-sniffer/PhpCollective/ruleset.xml" >
59
- <exclude name =" SlevomatCodingStandard.Functions.DisallowNamedArguments" />
60
- <exclude name =" SlevomatCodingStandard.Functions.DisallowTrailingCommaInDeclaration" />
61
- <exclude name =" SlevomatCodingStandard.Classes.DisallowConstructorPropertyPromotion" />
62
- <exclude name =" SlevomatCodingStandard.ControlStructures.DisallowNullSafeObjectOperator" />
58
+ <exclude name =" PhpCollective.ControlStructures.DisallowCloakingCheck" />
63
59
...
64
60
</rule >
65
61
```
66
- They are shipped by default to avoid PHP8- creep into PHP7.4+ code.
62
+ Some sniffs are shipped by default to avoid PHP 8.2+ creep into PHP 8.1 code.
67
63
68
64
## Customize PHP version safety
69
65
70
66
If you want to enable ` PhpCollective.Internal.DisallowFunctions ` for your project level, set this into your ` phpcs.xml ` file:
71
67
``` xml
72
68
<rule ref =" PhpCollective.Internal.DisallowFunctions" >
73
69
<properties >
74
- <property name =" phpVersion" value =" 7.4 " />
70
+ <property name =" phpVersion" value =" 8.1 " />
75
71
</properties >
76
72
</rule >
77
73
```
@@ -120,7 +116,7 @@ You can also use `"FQCN"` of the sniff instead (".." quotes are important as the
120
116
Tip: When running it without argument, it shows you the sniffs that are yet untested.
121
117
122
118
### Tokenizing Tool
123
- When coding new sniffs it really helps to see what the code looks like in regards of the token arrays.
119
+ When coding new sniffs it really helps to see what the code looks like in regard to the token arrays.
124
120
So we can parse a PHP file into its tokens using the following tool:
125
121
126
122
```
0 commit comments