Explorar o código

Added PHP Compatibility check

Edgard %!s(int64=5) %!d(string=hai) anos
pai
achega
b5f0d43c78
Modificáronse 3 ficheiros con 67 adicións e 2 borrados
  1. 6 0
      .phpcs.xml
  2. 1 0
      composer.json
  3. 60 2
      composer.lock

+ 6 - 0
.phpcs.xml

@@ -3,6 +3,9 @@
 
    <!-- rules -->
    <rule ref="./vendor/glpi-project/coding-standard/GlpiStandard" />
+   <rule ref="./vendor/phpcompatibility/php-compatibility/PHPCompatibility">
+      <exclude name="PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.FunctionDoubleUnderscore" />
+   </rule>
 
    <!-- Indent 3 -->
    <rule ref="Generic.WhiteSpace.ScopeIndent">
@@ -19,6 +22,9 @@
    <file>.</file>
    <exclude-pattern>vendor</exclude-pattern>
 
+   <!-- Check for cross-version support for PHP 5.6 and higher. -->
+   <config name="testVersion" value="5.4-"/>
+
    <!-- args -->
    <arg name="extensions" value="php,php5,inc"/>
    <arg name="encoding" value="UTF-8"/>

+ 1 - 0
composer.json

@@ -3,6 +3,7 @@
     "description": "Single Sign-On (OAuth) for GLPI",
     "require-dev": {
         "glpi-project/coding-standard": "^0.8",
+        "phpcompatibility/php-compatibility": "^9.3",
         "squizlabs/php_codesniffer": "^3.5"
     },
     "scripts": {

+ 60 - 2
composer.lock

@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "910e9dd12a31628d471c653c43e32f92",
+    "content-hash": "74275a109c221b0ce3813266b1c6c246",
     "packages": [],
     "packages-dev": [
         {
@@ -119,6 +119,64 @@
             },
             "time": "2020-06-03T08:54:27+00:00"
         },
+        {
+            "name": "phpcompatibility/php-compatibility",
+            "version": "9.3.5",
+            "source": {
+                "type": "git",
+                "url": "https://github.com/PHPCompatibility/PHPCompatibility.git",
+                "reference": "9fb324479acf6f39452e0655d2429cc0d3914243"
+            },
+            "dist": {
+                "type": "zip",
+                "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243",
+                "reference": "9fb324479acf6f39452e0655d2429cc0d3914243",
+                "shasum": ""
+            },
+            "require": {
+                "php": ">=5.3",
+                "squizlabs/php_codesniffer": "^2.3 || ^3.0.2"
+            },
+            "conflict": {
+                "squizlabs/php_codesniffer": "2.6.2"
+            },
+            "require-dev": {
+                "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0"
+            },
+            "suggest": {
+                "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.",
+                "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues."
+            },
+            "type": "phpcodesniffer-standard",
+            "notification-url": "https://packagist.org/downloads/",
+            "license": [
+                "LGPL-3.0-or-later"
+            ],
+            "authors": [
+                {
+                    "name": "Wim Godden",
+                    "homepage": "https://github.com/wimg",
+                    "role": "lead"
+                },
+                {
+                    "name": "Juliette Reinders Folmer",
+                    "homepage": "https://github.com/jrfnl",
+                    "role": "lead"
+                },
+                {
+                    "name": "Contributors",
+                    "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors"
+                }
+            ],
+            "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.",
+            "homepage": "http://techblog.wimgodden.be/tag/codesniffer/",
+            "keywords": [
+                "compatibility",
+                "phpcs",
+                "standards"
+            ],
+            "time": "2019-12-27T09:44:58+00:00"
+        },
         {
             "name": "phpstan/phpdoc-parser",
             "version": "0.4.9",
@@ -300,5 +358,5 @@
     "platform-overrides": {
         "php": "7.1.2"
     },
-    "plugin-api-version": "2.0.0"
+    "plugin-api-version": "1.1.0"
 }