Skip to content

Commit 83d18e6

Browse files
authored
Merge pull request #1 from PHPCompatibility/feature/initial-release
Initial commit / v 1.0.0
2 parents fb5bdf5 + 18c0fac commit 83d18e6

File tree

20 files changed

+417
-1
lines changed

20 files changed

+417
-1
lines changed

.gitattributes

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#
2+
# Exclude these files from release archives.
3+
# https://blog.madewithlove.be/post/gitattributes/
4+
#
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/.github/ export-ignore
9+
/Test/ export-ignore
10+
11+
#
12+
# Auto detect text files and perform LF normalization
13+
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/
14+
#
15+
* text=auto

.github/issue_template.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!--
2+
This repository is only for the PHPCompatibilitySymfony rulesets, which prevent false positives from the PHPCompatibility standard by excluding the poly-fills which are provided by the various Symfony polyfill libraries.
3+
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+
6+
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.
7+
8+
Thanks!
9+
-->

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor/
2+
composer.lock

.travis.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
sudo: false
2+
3+
dist: trusty
4+
5+
cache:
6+
apt: true
7+
8+
language: php
9+
10+
## Cache composer downloads.
11+
cache:
12+
directories:
13+
- $HOME/.cache/composer/files
14+
15+
matrix:
16+
fast_finish: true
17+
include:
18+
- php: 7.2
19+
addons:
20+
apt:
21+
packages:
22+
- libxml2-utils
23+
- php: 5.4
24+
25+
before_install:
26+
# Speed up build time by disabling Xdebug when its not needed.
27+
- if [[ $COVERALLS_VERSION == "notset" ]]; then phpenv config-rm xdebug.ini || echo 'No xdebug config.'; fi
28+
- export XMLLINT_INDENT=" "
29+
- composer install
30+
- vendor/bin/phpcs -i
31+
32+
script:
33+
- |
34+
if [[ $TRAVIS_PHP_VERSION == "7.2" ]]; then
35+
# Validate the xml files.
36+
# @link http://xmlsoft.org/xmllint.html
37+
xmllint --noout ./*/ruleset.xml
38+
39+
# Check the code-style consistency of the xml files.
40+
diff -B ./PHPCompatibilitySymfonyPolyfillPHP54/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP54/ruleset.xml")
41+
diff -B ./PHPCompatibilitySymfonyPolyfillPHP55/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP55/ruleset.xml")
42+
diff -B ./PHPCompatibilitySymfonyPolyfillPHP56/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP56/ruleset.xml")
43+
diff -B ./PHPCompatibilitySymfonyPolyfillPHP70/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP70/ruleset.xml")
44+
diff -B ./PHPCompatibilitySymfonyPolyfillPHP71/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP71/ruleset.xml")
45+
diff -B ./PHPCompatibilitySymfonyPolyfillPHP72/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP72/ruleset.xml")
46+
diff -B ./PHPCompatibilitySymfonyPolyfillPHP73/ruleset.xml <(xmllint --format "./PHPCompatibilitySymfonyPolyfillPHP73/ruleset.xml")
47+
fi
48+
49+
# Test the rulesets.
50+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP54Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP54 --runtime-set testVersion 5.3
51+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP55Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP55 --runtime-set testVersion 5.3
52+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP56Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3
53+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP70Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP70 --runtime-set testVersion 5.3
54+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP71Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP71 --runtime-set testVersion 5.3
55+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP72Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP72 --runtime-set testVersion 5.3
56+
- vendor/bin/phpcs ./Test/SymfonyPolyfillPHP73Test.php --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 5.3
57+
58+
# Validate the composer.json file.
59+
# @link https://getcomposer.org/doc/03-cli.md#validate
60+
- composer validate --no-check-all --strict
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPCompatibilitySymfonyPolyfillPHP54">
3+
<description>PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Symfony PHP 5.4 library.</description>
4+
5+
<rule ref="PHPCompatibility">
6+
<!-- https://github.com/symfony/polyfill-php54/blob/master/bootstrap.php -->
7+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.trait_existsFound"/>
8+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.class_usesFound"/>
9+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.hex2binFound"/>
10+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.session_register_shutdownFound"/>
11+
12+
<!-- https://github.com/symfony/polyfill-php54/tree/master/Resources/stubs -->
13+
<exclude name="PHPCompatibility.Classes.NewClasses.callbackfilteriteratorFound"/>
14+
<exclude name="PHPCompatibility.Classes.NewClasses.recursivecallbackfilteriteratorFound"/>
15+
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.sessionhandlerinterfaceFound"/>
16+
</rule>
17+
18+
</ruleset>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPCompatibilitySymfonyPolyfillPHP55">
3+
<description>PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Symfony PHP 5.5 library.</description>
4+
5+
<!-- https://github.com/symfony/polyfill-php55/blob/master/composer.json -->
6+
<rule ref="PHPCompatibilityPasswordCompat"/>
7+
8+
<rule ref="PHPCompatibility">
9+
<!-- https://github.com/symfony/polyfill-php55/blob/master/bootstrap.php -->
10+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_columnFound"/>
11+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.boolvalFound"/>
12+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.hash_pbkdf2Found"/>
13+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_last_error_msgFound"/>
14+
</rule>
15+
16+
</ruleset>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPCompatibilitySymfonyPolyfillPHP56">
3+
<description>PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Symfony PHP 5.6 libary.</description>
4+
5+
<rule ref="PHPCompatibility">
6+
<!-- https://github.com/symfony/polyfill-php56/blob/master/bootstrap.php -->
7+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.hash_equalsFound"/>
8+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.ldap_escapeFound"/>
9+
</rule>
10+
11+
</ruleset>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPCompatibilitySymfonyPolyfillPHP70">
3+
<description>PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Symfony PHP 7.0 library.</description>
4+
5+
<!-- https://github.com/symfony/polyfill-php70/blob/master/composer.json -->
6+
<rule ref="PHPCompatibilityParagonieRandomCompat"/>
7+
8+
<rule ref="PHPCompatibility">
9+
<!-- https://github.com/symfony/polyfill-php70/blob/master/bootstrap.php -->
10+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.intdivFound"/>
11+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.preg_replace_callback_arrayFound"/>
12+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.error_clear_lastFound"/>
13+
<exclude name="PHPCompatibility.Constants.NewConstants.php_int_minFound"/>
14+
15+
<!-- https://github.com/symfony/polyfill-php70/tree/master/Resources/stubs -->
16+
<exclude name="PHPCompatibility.Classes.NewClasses.errorFound"/>
17+
<exclude name="PHPCompatibility.Classes.NewClasses.arithmeticerrorFound"/>
18+
<exclude name="PHPCompatibility.Classes.NewClasses.assertionerrorFound"/>
19+
<exclude name="PHPCompatibility.Classes.NewClasses.divisionbyzeroerrorFound"/>
20+
<exclude name="PHPCompatibility.Classes.NewClasses.parseerrorFound"/>
21+
<exclude name="PHPCompatibility.Classes.NewClasses.typeerrorFound"/>
22+
23+
<exclude name="PHPCompatibility.Interfaces.NewInterfaces.sessionupdatetimestamphandlerinterfaceFound"/>
24+
</rule>
25+
26+
</ruleset>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPCompatibilitySymfonyPolyfillPHP71">
3+
<description>PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Symfony PHP 7.1 library.</description>
4+
5+
<rule ref="PHPCompatibility">
6+
<!-- https://github.com/symfony/polyfill-php71/blob/master/bootstrap.php -->
7+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.is_iterableFound"/>
8+
</rule>
9+
10+
</ruleset>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="PHPCompatibilitySymfonyPolyfillPHP72">
3+
<description>PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Symfony PHP 7.2 library.</description>
4+
5+
<rule ref="PHPCompatibility">
6+
<!-- https://github.com/symfony/polyfill-php72/blob/master/bootstrap.php -->
7+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.sapi_windows_vt100_supportFound"/>
8+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.stream_isattyFound"/>
9+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.utf8_encodeFound"/>
10+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.utf8_decodeFound"/>
11+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.spl_object_idFound"/>
12+
<exclude name="PHPCompatibility.Constants.NewConstants.php_os_familyFound"/>
13+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_ordFound"/>
14+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_chrFound"/>
15+
<exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_scrubFound"/>
16+
</rule>
17+
18+
</ruleset>

0 commit comments

Comments
 (0)