You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This update accounts for the following changes:
* Composer:
- Require the polyfill repos.
- Improved the project description and added to the keywords.
* Travis: remove old caching reference. The travis images now do a `composer self-update` by default.
* Issue template: updated to point to the additional repos.
* Readme:
- Added information about the polyfill rulesets.
- Added section about only testing PHP files.
- Added changelog for version 1.1.0.
This repository is only a convenience wrapper to easily install all PHPCompatibility PHPCS standards in one go.
2
+
This repository is only a convenience wrapper to easily install all PHPCompatibility PHP_CodeSniffer standards in one go.
3
3
4
4
If your issue is related to the PHPCompatibility sniffs, please open an issue in the PHPCompatibility repository: https://github.com/PHPCompatibility/PHPCompatibility/issues
5
5
6
-
If your issue is related to the PHPCompatibilityJoomla ruleset, please open an issue in the PHPCompatibilityJoomla repository: https://github.com/PHPCompatibility/PHPCompatibilityJoomla/issues
6
+
If your issue is related to a framework specific ruleset, please open an issue in the relevant repository:
If your issue is related to the PHPCompatibilityWP ruleset, please open an issue in the PHPCompatibilityWP repository: https://github.com/PHPCompatibility/PHPCompatibilityWP/issues
10
+
If your issue is related to a polyfill specific ruleset, please open an issue in the relevant repository:
Before opening a new issue, please search for duplicate issues to prevent opening a duplicate. If there is already an open issue, please leave a comment there.
15
+
Before opening a new issue, please search for your issue to prevent opening a duplicate. If there is already an open issue, please leave a comment there.
Copy file name to clipboardExpand all lines: README.md
+38-2Lines changed: 38 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,12 @@ Convenience package to install all the external PHP_CodeSniffer rulesets which t
17
17
-[](https://packagist.org/packages/PHPCompatibility/phpcompatibility-joomla)[PHPCompatibilityJoomla](https://github.com/PHPCompatibility/PHPCompatibilityJoomla) - PHPCompatibility ruleset specific for Joomla projects.
18
18
-[](https://packagist.org/packages/PHPCompatibility/phpcompatibility-wp)[PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP) - PHPCompatibility ruleset specific for WordPress projects.
19
19
20
+
### Polyfill provider specific rulesets
21
+
-[](https://packagist.org/packages/phpcompatibility/phpcompatibility-passwordcompat)[PHPCompatibilityPasswordCompat](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat) - PHPCompatibility ruleset specific for projects which use @ircmaxell's [`password_compat`](https://github.com/ircmaxell/password_compat) polyfill library.
22
+
-[](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie)[PHPCompatibilityParagonie](https://github.com/PHPCompatibility/PHPCompatibilityParagonie) - PHPCompatibility rulesets for projects using either the Paragonie [`random_compat`](https://github.com/paragonie/random_compat) or the Paragonie [`sodium_compat`](https://github.com/paragonie/sodium_compat) polyfill library, or both.
23
+
-[](https://packagist.org/packages/phpcompatibility/phpcompatibility-symfony)[PHPCompatibilitySymfony](https://github.com/PHPCompatibility/PHPCompatibilitySymfony) - PHPCompatibility rulesets for projects using any of the [PHP polyfill libraries](https://github.com/symfony?utf8=?&q=polyfill) provided by the Symfony project.
24
+
For more details about the available rulesets, please check out the [README of the PHPCompatibilitySymfony](https://github.com/PHPCompatibility/PHPCompatibilitySymfony/blob/master/README.md) repository.
25
+
20
26
21
27
## Requirements
22
28
@@ -25,6 +31,7 @@ Convenience package to install all the external PHP_CodeSniffer rulesets which t
25
31
*[Composer](https://getcomposer.org/)
26
32
27
33
Use the latest stable release of PHP_CodeSniffer for the best results.
34
+
The minimum _recommended_ version of PHP_CodeSniffer is version 2.6.0.
If all went well, you will now see that the `PHPCompatibility`, `PHPCompatibilityJoomla` and `PHPCompatibilityWP` standards are installed for PHP_CodeSniffer.
55
+
If all went well, you will now see that the `PHPCompatibility`, `PHPCompatibilityJoomla`, `PHPCompatibilityWP` and a number of polyfill related standards are installed for PHP_CodeSniffer.
49
56
50
57
51
58
## How to use
@@ -55,6 +62,15 @@ Now you can use any of the following commands to inspect your code:
By default, you will only receive notifications about deprecated and/or removed PHP features.
@@ -65,9 +81,25 @@ To get the most out of the PHPCompatibility standards, you should specify a `tes
65
81
* You can also specify a range of PHP versions that your code needs to support. In this situation, compatibility issues that affect any of the PHP versions in that range will be reported: `--runtime-set testVersion 5.3-5.5`.
66
82
* Since PHPCompatibility 7.1.3, you can omit one part of the range if you want to support everything above or below a particular version, i.e. use `--runtime-set testVersion 7.0-` to run all the checks for PHP 7.0 and above.
67
83
84
+
For example:
85
+
```bash
86
+
# For a Joomla project which should be compatible with PHP 5.3 up to and including PHP 7.0:
# For a project using both the Paragonie Sodium Compat polyfill as well as the Symfony PHP 7.1 polyfill and which should be compatible with PHP 5.4 and higher:
For more detailed information, see the README of the main [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility#sniffing-your-code-for-compatibility-with-specific-php-versions) standard.
69
94
70
95
96
+
### Testing PHP files only
97
+
98
+
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:
Copy file name to clipboardExpand all lines: composer.json
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
{
2
2
"name" : "phpcompatibility/phpcompatibility-all",
3
-
"description" : "A set of external standards for PHP_CodeSniffer that check for PHP version compatibility and can modernize code.",
3
+
"description" : "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues and opportunities to modernize code in PHP projects.",
0 commit comments