Skip to content

Commit b1d036a

Browse files
authored
Merge pull request #58 from PHPCompatibility/feature/update-for-phpcompatibility-10.0.0-alpha1
Version 3.0.0-alpha1 / Update for PHPCompatibility 10.0.0-alpha1
2 parents 7c4af43 + cbfd3b5 commit b1d036a

File tree

3 files changed

+61
-38
lines changed

3 files changed

+61
-38
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767

6868
include:
6969
- php: '7.4'
70-
phpcompat: 'dev-develop as 9.99.99'
70+
phpcompat: 'dev-develop as 10.99.99'
7171
experimental: true
7272

7373
name: "Test: PHP ${{ matrix.php }} - PHPCompat ${{ matrix.phpcompat }}"
@@ -102,4 +102,7 @@ jobs:
102102

103103
# Make sure that known polyfills don't trigger any errors.
104104
- name: Test the ruleset
105-
run: vendor/bin/phpcs -ps ./Test/JoomlaTest.php --standard=PHPCompatibilityJoomla --runtime-set testVersion 5.3-
105+
run: >
106+
vendor/bin/phpcs -ps ./Test/JoomlaTest.php --standard=PHPCompatibilityJoomla
107+
--exclude=PHPCompatibility.Upgrade.LowPHP
108+
--runtime-set testVersion 5.3-

README.md

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# PHPCompatibilityJoomla
22

3-
[![Latest Stable Version](https://img.shields.io/packagist/v/phpcompatibility/phpcompatibility-joomla?label=stable)](https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla)
4-
[![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla)
3+
[![Latest Stable Version](https://img.shields.io/packagist/v/phpcompatibility/phpcompatibility-joomla?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/PHPCompatibilityJoomla?color=00a7a7)](https://github.com/PHPCompatibility/PHPCompatibilityJoomla/blob/master/LICENSE)
66
[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilityJoomla/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilityJoomla/actions/workflows/ci.yml)
77

@@ -12,36 +12,39 @@ Using PHPCompatibilityJoomla, you can analyse the codebase of a Joomla-based pro
1212

1313
A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects based on the Joomla CMS.
1414

15-
This Joomla specific ruleset prevents false positives from the [PHPCompatibility standard](https://github.com/PHPCompatibility/PHPCompatibility) by excluding back-fills and poly-fills which are provided by Joomla.
15+
This Joomla specific ruleset prevents false positives from the [PHPCompatibility standard][PHPCompatibility] by excluding back-fills and polyfills which are provided by Joomla.
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+.
27-
* [PHPCompatibilityParagonie](https://github.com/PHPCompatibility/PHPCompatibilityParagonie) 1.0.0+.
28-
* [PHPCompatibilityPasswordCompat](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat) 1.0.0+.
29-
* [PHPCompatibilitySymfony](https://github.com/PHPCompatibility/PHPCompatibilitySymfony) 1.0.0+.
32+
* [PHPCompatibility] 10.0.0+.
33+
* [PHPCompatibilityParagonie] 2.0.0+.
34+
* [PHPCompatibilityPasswordCompat] 2.0.0+.
35+
* [PHPCompatibilitySymfony] 2.0.0+.
3036

3137

3238
## Installation instructions
3339

34-
The only supported installation method is via [Composer](https://getcomposer.org/).
40+
The only supported installation method is via [Composer].
3541

36-
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:
37-
```bash
38-
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
39-
composer require --dev dealerdirect/phpcodesniffer-composer-installer:"^0.7" phpcompatibility/phpcompatibility-joomla:"*"
40-
```
42+
[Composer] will automatically install the project dependencies and register the external rulesets with PHP_CodeSniffer using the [Composer PHPCS plugin].
4143

42-
If you already have a Composer PHP_CodeSniffer plugin installed, run:
44+
Run the following from the root of your project:
4345
```bash
44-
composer require --dev phpcompatibility/phpcompatibility-joomla:"*"
46+
composer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true
47+
composer require --dev phpcompatibility/phpcompatibility-joomla:"^3.0@dev"
4548
```
4649

4750
Next, run:
@@ -51,11 +54,22 @@ vendor/bin/phpcs -i
5154
If all went well, you will now see that the `PHPCompatibility`, `PHPCompatibilityJoomla` and several other PHPCompatibility standards are installed for PHP_CodeSniffer.
5255

5356

57+
## Upgrade instructions
58+
59+
To upgrade this package, run the following command:
60+
```bash
61+
composer update --dev phpcompatibility/phpcompatibility-joomla --with-dependencies
62+
```
63+
64+
> [!TIP]
65+
> 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.
66+
67+
5468
## How to use
5569

56-
Now you can use the following command to inspect your code:
70+
You can now use the following command to inspect your code:
5771
```bash
58-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityJoomla
72+
vendor/bin/phpcs -p . --standard=PHPCompatibilityJoomla
5973
```
6074

6175
By default, you will only receive notifications about deprecated and/or removed PHP features.
@@ -67,19 +81,31 @@ The minimum PHP requirement of the Joomla project at this time is PHP 5.3.10. If
6781
For example:
6882
```bash
6983
# For a project which should be compatible with PHP 5.3 and higher:
70-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityJoomla --runtime-set testVersion 5.3-
84+
vendor/bin/phpcs -p . --standard=PHPCompatibilityJoomla --runtime-set testVersion 5.3-
7185
```
7286

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

7589

7690
### Testing PHP files only
7791

78-
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:
92+
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:
7993
```bash
80-
./vendor/bin/phpcs -p . --standard=PHPCompatibilityJoomla --extensions=php --runtime-set testVersion 5.3-
94+
vendor/bin/phpcs -p . --standard=PHPCompatibilityJoomla --extensions=php --runtime-set testVersion 5.3-
8195
```
8296

8397
## License
8498

8599
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>.
100+
101+
102+
[packagist]: https://packagist.org/packages/phpcompatibility/phpcompatibility-joomla
103+
[Composer]: https://getcomposer.org/
104+
[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer/
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
109+
[PHPCompatibilityParagonie]: https://github.com/PHPCompatibility/PHPCompatibilityParagonie
110+
[PHPCompatibilityPasswordCompat]: https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat
111+
[PHPCompatibilitySymfony]: https://github.com/PHPCompatibility/PHPCompatibilitySymfony

composer.json

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,10 @@
2929
"lock": false
3030
},
3131
"require" : {
32-
"phpcompatibility/php-compatibility" : "^9.0",
33-
"phpcompatibility/phpcompatibility-paragonie" : "^1.0",
34-
"phpcompatibility/phpcompatibility-symfony" : "^1.0"
35-
},
36-
"require-dev" : {
37-
"dealerdirect/phpcodesniffer-composer-installer": "^1.0"
38-
},
39-
"suggest" : {
40-
"dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
41-
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
32+
"phpcompatibility/php-compatibility" : "^10.0@dev",
33+
"phpcompatibility/phpcompatibility-passwordcompat" : "^2.0@dev",
34+
"phpcompatibility/phpcompatibility-paragonie" : "^2.0@dev",
35+
"phpcompatibility/phpcompatibility-symfony" : "^2.0@dev"
4236
},
4337
"prefer-stable" : true
4438
}

0 commit comments

Comments
 (0)