Skip to content

Commit d3ac78c

Browse files
authored
Merge pull request #51 from PHPCompatibility/feature/update-for-phpcompatibility-10.0.0-alpha1
Version 2.0.0-alpha1 / Update for PHPCompatibility 10.0.0-alpha1
2 parents 17a981b + 393cf7c commit d3ac78c

File tree

3 files changed

+63
-38
lines changed

3 files changed

+63
-38
lines changed

.github/workflows/ci.yml

Lines changed: 10 additions & 5 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 }}"
@@ -103,10 +103,15 @@ jobs:
103103

104104
# Make sure that known polyfills don't trigger any errors.
105105
- name: Test the ruleset
106-
run: |
107-
vendor/bin/phpcs -ps ./Test/PasswordCompatTest.php --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.4-
106+
run: >
107+
vendor/bin/phpcs -ps ./Test/PasswordCompatTest.php --standard=PHPCompatibilityPasswordCompat
108+
--exclude=PHPCompatibility.Upgrade.LowPHP
109+
--runtime-set testVersion 5.4-
108110
109111
# Check that the ruleset doesn't throw unnecessary errors for the compat library itself.
110112
- name: Test running against the polyfills
111-
run: |
112-
vendor/bin/phpcs -ps ./vendor/ircmaxell/ --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.4- --ignore=/password-compat/test/*
113+
run: >
114+
vendor/bin/phpcs -ps ./vendor/ircmaxell/ --standard=PHPCompatibilityPasswordCompat
115+
--exclude=PHPCompatibility.Upgrade.LowPHP
116+
--ignore=/password-compat/test/*
117+
--runtime-set testVersion 5.4-

README.md

Lines changed: 52 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,47 @@
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

18-
## Requirements
18+
## Funding
19+
20+
**This project needs funding.**
21+
22+
The project team has spend thousands of hours creating and maintaining the PHPCompatibility packages. This is unsustainable without funding.
1923

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+.
24+
If you use PHPCompatibility, please fund this work by setting up a monthly contribution to the [PHP_CodeSniffer Open Collective].
2325

26+
27+
## Requirements
28+
29+
* PHP > 5.4
30+
* [PHP_CodeSniffer] >= 3.13.3.
2431
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+.
32+
* [PHPCompatibility] 10.0.0+.
2733

2834

2935
## Installation instructions
3036

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

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-
```
39+
[Composer] will automatically install the project dependencies and register the external rulesets with PHP_CodeSniffer using the [Composer PHPCS plugin].
3840

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

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

5053

54+
## Upgrade instructions
55+
56+
To upgrade this package, run the following command:
57+
```bash
58+
composer update --dev phpcompatibility/phpcompatibility-passwordcompat --with-dependencies
59+
```
60+
61+
> [!TIP]
62+
> 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.
63+
64+
5165
## How to use
5266

53-
Now you can use the following command to inspect the code in your project for PHP cross-version compatibility:
67+
You can now use the following command to inspect the code in your project for PHP cross-version compatibility:
5468
```bash
55-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat
69+
vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat
5670
```
5771

5872
By default, you will only receive notifications about deprecated and/or removed PHP features.
@@ -62,22 +76,33 @@ To get the most out of the PHPCompatibilityPasswordCompat standard, you should s
6276
For example:
6377
```bash
6478
# 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
79+
vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.3-7.0
6680

6781
# 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-
82+
vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --runtime-set testVersion 5.4-
6983
```
7084

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.
85+
For more detailed information about setting the `testVersion`, see the README of the generic [PHPCompatibility][PHPCompatibility-testVersion] standard.
7286

7387

7488
### Testing PHP files only
7589

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:
90+
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:
7791
```bash
78-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --extensions=php --runtime-set testVersion 5.3-
92+
vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat --extensions=php --runtime-set testVersion 5.3-
7993
```
8094

8195
## License
8296

83-
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>
97+
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>.
98+
99+
100+
[packagist]: https://packagist.org/packages/phpcompatibility/phpcompatibility-passwordcompat
101+
[Composer]: https://getcomposer.org/
102+
[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer/
103+
[ircmaxell]: https://github.com/ircmaxell/
104+
[password_compat]: https://github.com/ircmaxell/password_compat
105+
[PHP_CodeSniffer]: https://github.com/PHPCSStandards/PHP_CodeSniffer
106+
[PHP_CodeSniffer Open Collective]: https://opencollective.com/php_codesniffer
107+
[PHPCompatibility]: https://github.com/PHPCompatibility/PHPCompatibility
108+
[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)