You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: wiki/Version-4.0-Developer-Upgrade-Guide.md
+17-17Lines changed: 17 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ There is a separate [[Upgrade Guide for Ruleset Maintainers and End-Users|Versio
52
52
It is highly recommended to upgrade external standards and integrations as soon as you are able.
53
53
54
54
Once PHP_CodeSniffer 4.0 has been released, the PHP_CodeSniffer 3.x branch will no longer receive updates, with the exception of security fixes and runtime compatibility fixes for new PHP versions.
55
-
This "limited support" will last a maximum of one year from the date of the PHP_Codesniffer 4.0.0 release.
55
+
This "limited support" will last a maximum of one year from the date of the PHP_CodeSniffer 4.0.0 release.
56
56
57
57
> [!IMPORTANT]
58
58
> This also means that support for new PHP syntaxes will only land in PHP_CodeSniffer 4.x and will **NOT** be backported to the 3.x branch.
@@ -519,7 +519,7 @@ The `protected` `getDeclarationNameWithNamespace()` and `getNamespaceOfScope()`
519
519
520
520
* `PHP_CodeSniffer\Ruleset::setSniffProperty()`: the BC-layer supporting the old array format for the `$settings` parameter for the method has been removed.
521
521
The `$settings` parameter must be passed as an array with the following two keys: `'scope'` and `'value'`, with `'scope'` being set to either `'sniff'` or `'standard'`, and `'value'` containing the new property value.
522
-
Also see https://github.com/squizlabs/PHP_CodeSniffer/pull/3629
522
+
Also see [squizlabs/PHP_CodeSniffer#3629](https://github.com/squizlabs/PHP_CodeSniffer/pull/3629).
523
523
524
524
* Various class properties have been replaced with class constants. Where these were in the public API (= the below list), the properties still exist, but are now (soft) deprecated and will be removed in PHP_CodeSniffer 5.0.
525
525
The visibility of the (deprecated) properties and their class constant replacements is the same.
@@ -544,9 +544,9 @@ The `protected` `getDeclarationNameWithNamespace()` and `getNamespaceOfScope()`
* The visibility of the following class constants has changed from `public` to `private`. If you used these in your own code, you will need to create your own constants instead:
547
-
- `PHP_CodeSniffer\Generators\HTML::STYLESHEET`
548
-
- `PHP_CodeSniffer\Util\Timing::MINUTE_IN_MS`
549
-
- `PHP_CodeSniffer\Util\Timing::SECOND_IN_MS`
547
+
* `PHP_CodeSniffer\Generators\HTML::STYLESHEET`
548
+
* `PHP_CodeSniffer\Util\Timing::MINUTE_IN_MS`
549
+
* `PHP_CodeSniffer\Util\Timing::SECOND_IN_MS`
550
550
551
551
* The `PHP_CodeSniffer\Util\Standards::printInstalledStandards()` method is deprecated and should no longer be used. Use `echo PHP_CodeSniffer\Util\Standards::prepareInstalledStandardsForDisplay()` instead once support for PHPCS 3.x is being dropped.
552
552
@@ -578,7 +578,7 @@ If an external standard uses its own test framework, this section can be skipped
578
578
* The test setup now supports PHPUnit 8, 9, 10 and 11, which is in line with the new minimum PHP version of 7.2.
579
579
Please read the changelogs for PHPUnit itself for information about the changes.
580
580
Most notable changes which will likely impact your tests:
581
-
- The test suite may need a separate PHPUnit config file for PHPUnit < 10 and PHPUnit 10+.
581
+
* The test suite may need a separate PHPUnit config file for PHPUnit < 10 and PHPUnit 10+.
582
582
* The custom `TestSuite` setup has been removed from the framework as it is no longer needed since PEAR support was dropped and was incompatible with PHPUnit 10.
583
583
* All abstract base test cases now use the `TestCase` class name suffix.
584
584
| Old Name | New Name |
@@ -589,22 +589,22 @@ If an external standard uses its own test framework, this section can be skipped
589
589
These methods now have `void` return type declarations.
590
590
* The global `printPHPCodeSnifferTestOutput()` function, which printed a "# sniff test files generated # unique error codes; # were fixable (#%)" summary after the tests is no longer available.
591
591
* The following properties which were previously available in the `AbstractSniffUnitTest` class have been removed:
592
-
- `protected $backupGlobals`
593
-
- `public $standardsDir`
594
-
- `public $testsDir`
592
+
* `protected $backupGlobals`
593
+
* `public $standardsDir`
594
+
* `public $testsDir`
595
595
The first is (very) old-school PHPUnit and should not be used anyway.
596
596
The last two were never intended to be overwritten by concrete test classes, so shouldn't have been public properties.
597
597
* The following property which was previously available in the `AbstractMethodUnitTest` class has been removed:
598
-
- `protected static $fileExtension`
598
+
* `protected static $fileExtension`
599
599
This property is redundant now support for JS/CSS files has been dropped.
600
600
* The test framework no longer uses global variables. I.e. the following are no longer available:
601
-
- `$GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS']`
602
-
- `$GLOBALS['PHP_CODESNIFFER_TEST_DIRS']`
603
-
- `$GLOBALS['PHP_CODESNIFFER_CONFIG']`
604
-
- `$GLOBALS['PHP_CODESNIFFER_RULESETS']`
605
-
- `$GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES']`
606
-
- `$GLOBALS['PHP_CODESNIFFER_SNIFF_CODES']`
607
-
- `$GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES']`
601
+
* `$GLOBALS['PHP_CODESNIFFER_STANDARD_DIRS']`
602
+
* `$GLOBALS['PHP_CODESNIFFER_TEST_DIRS']`
603
+
* `$GLOBALS['PHP_CODESNIFFER_CONFIG']`
604
+
* `$GLOBALS['PHP_CODESNIFFER_RULESETS']`
605
+
* `$GLOBALS['PHP_CODESNIFFER_SNIFF_CASE_FILES']`
606
+
* `$GLOBALS['PHP_CODESNIFFER_SNIFF_CODES']`
607
+
* `$GLOBALS['PHP_CODESNIFFER_FIXABLE_CODES']`
608
608
* Sniff tests which extend the `AbstractSniffTestCase` for which no test case files (`.inc` files) can be found, will now be marked as "incomplete".
609
609
* Sniff tests which extend the `AbstractSniffTestCase` for which no `.fixed` files can be found, while the sniff would make fixes to the test case file, will now fail.
0 commit comments