Skip to content

Commit 0d698c8

Browse files
committed
Version 2.0.0-alpha1 / Update for PHPCompatibility 10.0.0-alpha1
This update accounts for the following changes: * Ruleset: **_No ruleset updates needed._** * Composer: - Update the version for the PHPCompatibility dependency. The `@dev` version number suffix should ensure that the PHPCompatibility 10.0.0-alpha1 version can be installed, even if the project minimum stability does not specifically allow for dev versions. - Remove the DealerDirect Composer PHPCS plugin dependency. This plugin will now automatically be installed as it is a dependency of PHPCSUtils and therefore of PHPCompatibility itself. Not having it set as an explicit dependency here, will prevent potential future conflicts with the supported versions of the plugin. - Removed the `suggest` section. The DealerDirect plugin no longer needs to be suggested and after two years, people should have gotten the message about using the `roave/security-advisories`. * Readme: - Updated the minimum PHP and PHPCS requirements. - Updated the installation instructions for the 2.0.0-alpha1 release (being a dev release). - Updated the installation instructions to no longer mention adding a Composer plugin to sort out the PHPCS `installed_paths`. - Added upgrade instructions. - Use link list for links used multiple times. - Minor other tweaks after critical read-through of the README. * CI: - Continue testing against `dev-develop`. - Prevent builds failing on low PHP versions on the recommendation to use a more recent PHP version.
1 parent 17a981b commit 0d698c8

3 files changed

Lines changed: 45 additions & 35 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868

6969
include:
7070
- php: '7.4'
71-
phpcompat: 'dev-develop as 9.99.99'
71+
phpcompat: 'dev-develop as 10.99.99'
7272
experimental: true
7373

7474
name: "Test: PHP ${{ matrix.php }} - PHPCompat ${{ matrix.phpcompat }}"
@@ -104,9 +104,9 @@ jobs:
104104
# Make sure that known polyfills don't trigger any errors.
105105
- name: Test the ruleset
106106
run: |
107-
vendor/bin/phpcs -ps ./Test/PasswordCompatTest.php --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.4-
107+
vendor/bin/phpcs -ps ./Test/PasswordCompatTest.php --standard=PHPCompatibilityPasswordCompat --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.4-
108108
109109
# Check that the ruleset doesn't throw unnecessary errors for the compat library itself.
110110
- name: Test running against the polyfills
111111
run: |
112-
vendor/bin/phpcs -ps ./vendor/ircmaxell/ --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.4- --ignore=/password-compat/test/*
112+
vendor/bin/phpcs -ps ./vendor/ircmaxell/ --standard=PHPCompatibilityPasswordCompat --exclude=PHPCompatibility.Upgrade.LowPHP --runtime-set testVersion 5.4- --ignore=/password-compat/test/*

README.md

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,38 @@
11
# PHPCompatibilityPasswordCompat
22

3-
[![Latest Stable Version](https://img.shields.io/packagist/v/phpcompatibility/phpcompatibility-passwordcompat?label=stable)](https://packagist.org/packages/phpcompatibility/phpcompatibility-passwordcompat)
4-
[![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcompatibility/phpcompatibility-passwordcompat)
3+
[![Latest Stable Version](https://img.shields.io/packagist/v/phpcompatibility/phpcompatibility-passwordcompat?label=stable)][packagist]
4+
[![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)][packagist]
55
[![License](https://img.shields.io/github/license/PHPCompatibility/PHPCompatibilityPasswordCompat?color=00a7a7)](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat/blob/master/LICENSE)
66
[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat/actions/workflows/ci.yml)
77

8-
Using PHPCompatibilityPasswordCompat, you can analyse the codebase of a project using using @[ircmaxell](https://github.com/ircmaxell/)'s [password_compat](https://github.com/ircmaxell/password_compat) polyfill library, for PHP cross-version compatibility.
8+
Using PHPCompatibilityPasswordCompat, you can analyse the codebase of a project using [@ircmaxell][ircmaxell]'s [password_compat] polyfill library, for PHP cross-version compatibility.
99

1010

1111
## What's in this repo ?
1212

13-
A rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the @ircmaxell's [password_compat](https://github.com/ircmaxell/password_compat) polyfill library.
13+
A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by [@ircmaxell][ircmaxell]'s [password_compat] polyfill library.
1414

15-
This ruleset prevents false positives from the [PHPCompatibility standard](https://github.com/PHPCompatibility/PHPCompatibility) by excluding back-fills and poly-fills which are provided by the `random_compat` library.
15+
This ruleset prevents false positives from the [PHPCompatibility standard][PHPCompatibility] by excluding back-fills and polyfills which are provided by the `password_compat` library.
1616

1717

1818
## Requirements
1919

20-
* [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer).
21-
- PHP 5.3+ for use with [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) 2.3.0+.
22-
- PHP 5.4+ for use with [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) 3.0.2+.
23-
20+
* PHP > 5.4
21+
* [PHP_CodeSniffer] >= 3.13.3.
2422
Use the latest stable release of PHP_CodeSniffer for the best results.
25-
The minimum _recommended_ version of PHP_CodeSniffer is version 2.6.0.
26-
* [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) 9.0.0+.
23+
* [PHPCompatibility] 10.0.0+.
2724

2825

2926
## Installation instructions
3027

31-
The only supported installation method is via [Composer](https://getcomposer.org/).
28+
The only supported installation method is via [Composer].
3229

33-
If you don't have a Composer plugin installed to manage the `installed_paths` setting for PHP_CodeSniffer, run the following from the command-line:
34-
```bash
35-
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
36-
composer require --dev dealerdirect/phpcodesniffer-composer-installer:"^0.7" phpcompatibility/phpcompatibility-passwordcompat:"*"
37-
```
30+
[Composer] will automatically install the project dependencies and register the external rulesets with PHP_CodeSniffer using the [Composer PHPCS plugin].
3831

39-
If you already have a Composer PHP_CodeSniffer plugin installed, run:
32+
Run the following from the root of your project:
4033
```bash
41-
composer require --dev phpcompatibility/phpcompatibility-passwordcompat:"*"
34+
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
35+
composer require --dev phpcompatibility/phpcompatibility-passwordcompat:"^2.0@dev"
4236
```
4337

4438
Next, run:
@@ -48,11 +42,22 @@ vendor/bin/phpcs -i
4842
If all went well, you will now see that the `PHPCompatibility` and `PHPCompatibilityPasswordCompat` standards are installed for PHP_CodeSniffer.
4943

5044

45+
## Upgrade instructions
46+
47+
To upgrade this package, run the following command:
48+
```bash
49+
composer update --dev phpcompatibility/phpcompatibility-passwordcompat --with-dependencies
50+
```
51+
52+
> [!TIP]
53+
> If you have a _root_ requirement in your project for one of the packages used by this project, you may need to update with `--with-all-dependencies` instead.
54+
55+
5156
## How to use
5257

53-
Now you can use the following command to inspect the code in your project for PHP cross-version compatibility:
58+
You can now use the following command to inspect the code in your project for PHP cross-version compatibility:
5459
```bash
55-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat
60+
vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat
5661
```
5762

5863
By default, you will only receive notifications about deprecated and/or removed PHP features.
@@ -62,22 +67,32 @@ To get the most out of the PHPCompatibilityPasswordCompat standard, you should s
6267
For example:
6368
```bash
6469
# For a project which should be compatible with PHP 5.3 up to and including PHP 7.0:
65-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.3-7.0
70+
vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.3-7.0
6671

6772
# For a project which should be compatible with PHP 5.4 and higher:
68-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.4-
73+
vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.4-
6974
```
7075

71-
For more detailed information about setting the `testVersion`, see the README of the generic [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions) standard.
76+
For more detailed information about setting the `testVersion`, see the README of the generic [PHPCompatibility][PHPCompatibility-testVersion] standard.
7277

7378

7479
### Testing PHP files only
7580

76-
By default PHP_CodeSniffer will analyse PHP, JavaScript and CSS files. As the PHPCompatibility sniffs only target PHP code, you can make the run slightly faster by telling PHP_CodeSniffer to only check PHP files, like so:
81+
By default PHP_CodeSniffer < 4.0 will analyse PHP, JavaScript and CSS files. As the PHPCompatibility sniffs only target PHP code, you can make the run slightly faster by telling PHP_CodeSniffer to only check PHP files, like so:
7782
```bash
78-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --extensions=php --runtime-set testVersion 5.3-
83+
vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --extensions=php --runtime-set testVersion 5.3-
7984
```
8085

8186
## License
8287

8388
All code within the PHPCompatibility organisation is released under the GNU Lesser General Public License (LGPL). For more information, visit <https://www.gnu.org/licenses/lgpl-3.0.html>
89+
90+
91+
[packagist]: https://packagist.org/packages/phpcompatibility/phpcompatibility-passwordcompat
92+
[Composer]: https://getcomposer.org/
93+
[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer/
94+
[ircmaxell]: https://github.com/ircmaxell/
95+
[password_compat]: https://github.com/ircmaxell/password_compat
96+
[PHP_CodeSniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer
97+
[PHPCompatibility]: https://github.com/PHPCompatibility/PHPCompatibility
98+
[PHPCompatibility-testVersion]: https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions

composer.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,10 @@
2525
"lock": false
2626
},
2727
"require" : {
28-
"phpcompatibility/php-compatibility" : "^9.0"
28+
"phpcompatibility/php-compatibility" : "^10.0@dev"
2929
},
3030
"require-dev" : {
31-
"dealerdirect/phpcodesniffer-composer-installer": "^1.0",
3231
"ircmaxell/password-compat": "dev-master"
3332
},
34-
"suggest" : {
35-
"dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
36-
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
37-
},
3833
"prefer-stable" : true
3934
}

0 commit comments

Comments
 (0)