Skip to content

Commit 3477614

Browse files
committed
4.0 | User upgrade guide: add information about (upcoming) branch rename and impact
1 parent 23ed0d8 commit 3477614

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

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

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ There is a separate [[Upgrade Guide for Sniff Developers and Integrators|Version
2525
* [Removed sniff properties](#removed-sniff-properties)
2626
* [Ignore Annotation syntax](#ignore-annotation-syntax)
2727
* [Exit codes](#exit-codes)
28+
* [Branch rename in the PHP_CodeSniffer repo](#upcoming-branch-rename-in-the-php_codesniffer-repo)
2829
* [Notable other changes and new features](#notable-other-changes-and-new-features)
2930
* [Progress, error and debug output is now send to STDERR](#progress-error-and-debug-output-is-now-send-to-stderr)
3031
* [Files without extension can now be scanned](#files-without-extension-can-now-be-scanned)
@@ -299,6 +300,39 @@ CI scripts or git pre-commit hooks may be checking explicitly for specific exit
299300
<p align="right"><a href="#table-of-contents">back to top</a></p>
300301

301302

303+
### [Upcoming] Branch rename in the PHP_CodeSniffer repo
304+
305+
Just before the final 4.0.0 release, the PHP_CodeSniffer `master` branch will be renamed to `3.x` and the default branch will change to `4.x`.
306+
307+
#### Upgrading
308+
309+
##### Referencing the PHP_CodeSniffer XSD file for rulesets
310+
311+
If your ruleset includes a reference to the PHP_CodeSniffer XSD file via a URL, that URL will become invalid.
312+
As of mid May 2025, the current PHP_CodeSniffer ruleset XSD file can be referenced via the following permalink: `https://schema.phpcodesniffer.com/phpcs.xsd`.
313+
Permalinks to the XSD file for specific minors are also available in the following format: `https://schema.phpcodesniffer.com/#.#/phpcs.xsd`.
314+
315+
Example changeset:
316+
```diff
317+
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
318+
name="Your ruleset name"
319+
- xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd">
320+
+ xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd">
321+
```
322+
323+
Relative file references like `xsi:noNamespaceSchemaLocation="./vendor/squizlabs/php_codesniffer/phpcs.xsd"` will continue to be valid.
324+
325+
##### Referencing the main branches in the repo
326+
327+
If you reference a development version of PHP_CodeSniffer in your `composer.json` file or in CI scripts, those references will need to be updated.
328+
What to update these to, depends on your use-case.
329+
330+
* If you want to use the latest development version of PHP_CodeSniffer, use the `4.x` branch. For Composer, references to the branch will need to look like this: `4.x-dev`.
331+
* If you want the last development version of the `3.x` branch - previously `master`, use `3.x`. For Composer, references to the branch will need to look like this: `3.x-dev`.
332+
333+
<p align="right"><a href="#table-of-contents">back to top</a></p>
334+
335+
302336
## Notable other changes and new features
303337

304338
### Progress, error and debug output is now send to STDERR

0 commit comments

Comments
 (0)