Skip to content

Commit f17584a

Browse files
committed
Version 1.1.0 / Add new Polyfill rulesets
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.
1 parent 2fc9f28 commit f17584a

File tree

4 files changed

+54
-13
lines changed

4 files changed

+54
-13
lines changed

.github/issue_template.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
<!--
2-
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.
33
44
If your issue is related to the PHPCompatibility sniffs, please open an issue in the PHPCompatibility repository: https://github.com/PHPCompatibility/PHPCompatibility/issues
55
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:
7+
* PHPCompatibilityJoomla: https://github.com/PHPCompatibility/PHPCompatibilityJoomla/issues
8+
* PHPCompatibilityWP: https://github.com/PHPCompatibility/PHPCompatibilityWP/issues
79
8-
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:
11+
* PHPCompatibilityParagonie: https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues
12+
* PHPCompatibilityPasswordCompat: https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat/issues
13+
* PHPCompatibilitySymfony: https://github.com/PHPCompatibility/PHPCompatibilitySymfony/issues
914
10-
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.
1116
1217
Thanks!
1318
-->

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ language: php
77
## Cache composer downloads.
88
cache:
99
directories:
10-
# Cache directory for older Composer versions.
11-
- $HOME/.composer/cache/files
12-
# Cache directory for more recent Composer versions.
1310
- $HOME/.cache/composer/files
1411

1512
php:

README.md

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ Convenience package to install all the external PHP_CodeSniffer rulesets which t
1717
- [![PHPCompatibilityJoomla Current Version](https://poser.pugx.org/phpcompatibility/phpcompatibility-joomla/v/stable.png)](https://packagist.org/packages/PHPCompatibility/phpcompatibility-joomla) [PHPCompatibilityJoomla](https://github.com/PHPCompatibility/PHPCompatibilityJoomla) - PHPCompatibility ruleset specific for Joomla projects.
1818
- [![PHPCompatibilityWP Current Version](https://poser.pugx.org/phpcompatibility/phpcompatibility-wp/v/stable.png)](https://packagist.org/packages/PHPCompatibility/phpcompatibility-wp) [PHPCompatibilityWP](https://github.com/PHPCompatibility/PHPCompatibilityWP) - PHPCompatibility ruleset specific for WordPress projects.
1919

20+
### Polyfill provider specific rulesets
21+
- [![PHPCompatibilityPasswordCompat Current Version](https://poser.pugx.org/phpcompatibility/phpcompatibility-passwordcompat/v/stable.png)](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+
- [![PHPCompatibilityParagonie Current Version](https://poser.pugx.org/PHPCompatibility/phpcompatibility-paragonie/v/stable.png)](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+
- [![PHPCompatibilitySymfony Current Version](https://poser.pugx.org/PHPCompatibility/phpcompatibility-symfony/v/stable.png)](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+
2026

2127
## Requirements
2228

@@ -25,6 +31,7 @@ Convenience package to install all the external PHP_CodeSniffer rulesets which t
2531
* [Composer](https://getcomposer.org/)
2632

2733
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.
2835

2936

3037
## Installation instructions
@@ -35,7 +42,7 @@ composer require --dev dealerdirect/phpcodesniffer-composer-installer:^0.4.3 php
3542
composer install
3643
```
3744

38-
If you already have a Composer PHPCS plugin installed, run:
45+
If you already have a Composer PHP_CodeSniffer plugin installed, run:
3946
```bash
4047
composer require --dev phpcompatibility/phpcompatibility-all:*
4148
composer install
@@ -45,7 +52,7 @@ Next, run:
4552
```bash
4653
vendor/bin/phpcs -i
4754
```
48-
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.
4956

5057

5158
## How to use
@@ -55,6 +62,15 @@ Now you can use any of the following commands to inspect your code:
5562
./vendor/bin/phpcs -p . --standard=PHPCompatibility
5663
./vendor/bin/phpcs -p . --standard=PHPCompatibilityJoomla
5764
./vendor/bin/phpcs -p . --standard=PHPCompatibilityWP
65+
./vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat
66+
./vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieRandomCompat
67+
./vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieSodiumCompat
68+
./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP54
69+
./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP73
70+
...etc...
71+
72+
# You can also combine the standards if your project uses several:
73+
./vendor/bin/phpcs -p . --standard=PHPCompatibilityPasswordCompat,PHPCompatibilitySymfonyPolyfillPHP70,PHPCompatibilityWP
5874
```
5975

6076
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
6581
* 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`.
6682
* 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.
6783

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:
87+
./vendor/bin/phpcs -p . --standard=PHPCompatibilityJoomla --runtime-set testVersion 5.3-7.0
88+
89+
# 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:
90+
./vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieSodiumCompat,PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.4-
91+
```
92+
6893
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.
6994

7095

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:
99+
```bash
100+
./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP56 --extensions=php --runtime-set testVersion 5.3-
101+
```
102+
71103
## License
72104

73105
All code within the PHPCompatibility organisation is released under the GNU Lesser General Public License (LGPL).
@@ -76,6 +108,10 @@ For more information, visit https://www.gnu.org/copyleft/lesser.html
76108

77109
## Changelog
78110

111+
### 1.1.0 - 2018-10-07
112+
113+
- Added the new PHPCompatibilityPasswordCompat, PHPCompatibilityParagonie, PHPCompatibilitySymfony rulesets.
114+
79115
### 1.0.0 - 2018-07-17
80116

81117
Initial release containing the PHPCompatibility, PHPCompatibilityJoomla and PHPCompatibilityWP rulesets.

composer.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"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.",
44
"type" : "phpcodesniffer-standard",
5-
"keywords" : [ "compatibility", "phpcs", "standards", "joomla", "wordpress" ],
5+
"keywords" : [ "compatibility", "phpcs", "standards", "joomla", "wordpress", "polyfills", "paragonie", "password_compat", "symfony" ],
66
"homepage" : "http://phpcompatibility.com/",
77
"license" : "LGPL-3.0-or-later",
88
"authors" : [ {
@@ -20,10 +20,13 @@
2020
"require" : {
2121
"phpcompatibility/php-compatibility" : "*",
2222
"phpcompatibility/phpcompatibility-wp" : "*",
23-
"phpcompatibility/phpcompatibility-joomla" : "*"
23+
"phpcompatibility/phpcompatibility-joomla" : "*",
24+
"phpcompatibility/phpcompatibility-paragonie" : "*",
25+
"phpcompatibility/phpcompatibility-passwordcompat" : "*",
26+
"phpcompatibility/phpcompatibility-symfony" : "*"
2427
},
2528
"suggest" : {
26-
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
29+
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.3 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.",
2730
"roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
2831
},
2932
"prefer-stable" : true

0 commit comments

Comments
 (0)