Skip to content

Commit 25f5587

Browse files
authored
Minor fixes and adjustments to the PHPCS 4.0 upgrade guides (#44)
1 parent 746718c commit 25f5587

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

wiki/Version-4.0-Developer-Upgrade-Guide.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ Type casting for sniff property values set from within a ruleset has been made m
120120

121121
**Upgrading**
122122

123-
Search for sniff which have `public` properties which can be changed from within a ruleset.
123+
Search for sniffs which have `public` properties which can be changed from within a ruleset.
124124

125125
* If the sniff has workarounds in place to handle non-lowercase string `'true'` or `'false'` values for boolean properties, those workarounds can be removed.
126126
* If the sniff has workarounds in place to handle (any case) string `'null'` values, those workarounds can be removed.
@@ -174,7 +174,7 @@ For "properties" declared in enums, which is still not allowed in PHP, the metho
174174

175175
##### Upgrading
176176

177-
The above is significant change in behaviour and how it needs to be handled will depend on the sniff calling the method.
177+
The above is a significant change in behaviour and how it needs to be handled will depend on the sniff calling the method.
178178

179179
It is recommended to search your codebase for all uses of the `File::getMemberProperties()` method and to review whether the code needs updating.
180180

@@ -194,7 +194,7 @@ Also, in all cases, the sniff may need to start taking PHP 8.4 properties on int
194194

195195
... and the associated `private Config::$overriddenDefaults` property is also no longer static.
196196

197-
In practice, this means that two consecutively created `Config` objects without the same process will now contain the same settings. Previously, settings overridden in the first Config instance, could not be set for the second Config instance.
197+
In practice, this means that two consecutively created `Config` objects in the same process will now contain the same settings. Previously, settings overridden in the first Config instance, could not be set for the second Config instance.
198198

199199
Typically, this may impact projects which call `new Config` consecutive times programmatically, whether it is for a custom integration or for a custom test suite.
200200

@@ -403,7 +403,7 @@ doSomething();
403403

404404
The `AbstractPatternSniff::__construct()` method no longer takes any arguments. The `$ignoreComments` parameter was deprecated in PHPCS 1.4.0.
405405

406-
Since PHPCS 1.4.0, the AbstractPatternSniff sets the `ignoreComments` option using a `public` var rather than through the constructor.
406+
Since PHPCS 1.4.0, the AbstractPatternSniff sets the `ignoreComments` option using a `public` var rather than through the constructor.
407407
This allows the setting to be overwritten in `ruleset.xml` files.
408408

409409
**Upgrading**
@@ -462,7 +462,7 @@ The `protected` `getDeclarationNameWithNamespace()` and `getNamespaceOfScope()`
462462

463463
* The signature of the `DummyFile::setErrorCounts()` method has changed and now expects the following parameters: `$errorCount, $warningCount, $fixableErrorCount, $fixableWarningCount, $fixedErrorCount, $fixedWarningCount`.
464464

465-
* The abstract `PHP_CodeSniffer\Filters\ExactMatch::getBlacklist()` and `PHP_CodeSniffer\Filters\ExactMatch::getWhitelist()` methods have been replaced with abstract `PHP_CodeSniffer\ExactMatch::getDisallowedFiles()` and `PHP_CodeSniffer\ExactMatch::getAllowedFiles()` methods.
465+
* The abstract `PHP_CodeSniffer\Filters\ExactMatch::getBlacklist()` and `PHP_CodeSniffer\Filters\ExactMatch::getWhitelist()` methods have been replaced with abstract `PHP_CodeSniffer\Filters\ExactMatch::getDisallowedFiles()` and `PHP_CodeSniffer\Filters\ExactMatch::getAllowedFiles()` methods.
466466
If you have custom classes which extend the `ExactMatch` class, implement the new `getDisallowedFiles()` and `getAllowedFiles()` methods instead.
467467
Note: this is a name change only. The functionality remains the same.
468468

wiki/Version-4.0-User-Upgrade-Guide.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ What to update these to, depends on your use-case.
321321

322322
## Notable other changes and new features
323323

324-
### Progress, error and debug output is now send to STDERR
324+
### Progress, error and debug output is now sent to STDERR
325325

326326
This change should make it more straight-forward to pipe output from PHP_CodeSniffer to a file.
327327

@@ -352,7 +352,7 @@ Previously a ruleset could already "extend" an array property for a sniff set by
352352

353353
As of PHP_CodeSniffer 4.0, a ruleset can also "extend" the default value of an array property as set in the sniff itself.
354354

355-
The upside of this is, that if you want to default value + some extras, you no longer need to duplicate the default values from sniff array properties in your ruleset.
355+
The upside of this is that, if you want to use the default value + some extras, you no longer need to duplicate the default values from sniff array properties in your ruleset.
356356
The downside is, of course, that if the default value of the property in the sniff changes, your scans may start failing without warning.
357357

358358
#### Upgrading

0 commit comments

Comments
 (0)