sirbrillig / phpcs-variable-analysis

Find undefined and unused variables with the PHP Codesniffer static analysis tool.
Other
135 stars 14 forks source link

Switch to PHPCSStandards/PHP_CodeSniffer #315

Closed jrfnl closed 9 months ago

jrfnl commented 9 months ago

⚠️ This is a DRAFT PR on purpose as it references releases which have not yet been tagged. Once the PHPCS 3.8.0 tag is available (which contains the Composer replace directive), this can/should be merged and released ASAP. ⚠️


Switch to PHPCSStandards/PHP_CodeSniffer

The Squizlabs repo has been abandoned. The project continues in a fork in the PHPCSStandards organisation.

Includes updating the dev required version of the Composer plugin, which should make sure that this repo already switches over to using the PHPCSStandards version of PHPCS.

Ref:

Closes #314

[OPTIONAL] Composer: raise the minimum supported PHPCS version to 3.8.0

... to prevent end-users from running into trouble with the name change.

The files in the Composer vendor/bin will only be replaced when the replace... directive is found and that is only available in the 3.8.0 tag. When the files in the Composer vendor/bin are not replaced, they will continue to point to the vendor/squizlabs/php_codesniffer directory which will no longer exist, leading to fatal "File not found" errors for end-users trying to run PHPCS/PHPCBF.

Includes updating references to the PHPCS version whenever relevant throughout the codebase.

Note: it should work fine without this change, but may lead to support requests.

Composer: update various version constraints

... after the tooling has also updated to the PHPCSStandards version of PHPCS.

Refs: * https://github.com/PHPCSStandards/PHPCSDevCS/releases

jrfnl commented 9 months ago

Update: The Composer package name will not change, so while this PR should still be merged at your convenience, no new release is needed to unblock end-users, nor does the minimum supported PHPCS version need to change.