{"id":19932026,"url":"https://github.com/phpcompatibility/phpcompatibilitysymfony","last_synced_at":"2025-05-03T11:30:53.202Z","repository":{"id":33106755,"uuid":"148994742","full_name":"PHPCompatibility/PHPCompatibilitySymfony","owner":"PHPCompatibility","description":"PHPCompatibility rulesets which can be included in projects using the Symfony polyfill libraries","archived":false,"fork":false,"pushed_at":"2024-04-24T16:03:35.000Z","size":89,"stargazers_count":6,"open_issues_count":1,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-10-29T22:46:25.246Z","etag":null,"topics":["php","php-codesniffer","phpcompatibility","phpcs-standard","symfony-polyfill-libraries"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PHPCompatibility.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"open_collective":"php_codesniffer","github":["PHPCompatibility","jrfnl"]}},"created_at":"2018-09-16T12:45:06.000Z","updated_at":"2024-09-24T17:33:25.000Z","dependencies_parsed_at":"2024-06-19T00:03:00.207Z","dependency_job_id":"e5f29b8b-c540-45a6-b05c-841021e0415c","html_url":"https://github.com/PHPCompatibility/PHPCompatibilitySymfony","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilitySymfony","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilitySymfony/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilitySymfony/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilitySymfony/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHPCompatibility","download_url":"https://codeload.github.com/PHPCompatibility/PHPCompatibilitySymfony/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224360233,"owners_count":17298319,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["php","php-codesniffer","phpcompatibility","phpcs-standard","symfony-polyfill-libraries"],"created_at":"2024-11-12T23:08:47.344Z","updated_at":"2025-05-03T11:30:53.180Z","avatar_url":"https://github.com/PHPCompatibility.png","language":"PHP","readme":"[![Latest Stable Version](https://img.shields.io/packagist/v/phpcompatibility/phpcompatibility-symfony?label=stable)](https://packagist.org/packages/phpcompatibility/phpcompatibility-symfony)\n[![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcompatibility/phpcompatibility-symfony)\n[![License](https://img.shields.io/github/license/PHPCompatibility/PHPCompatibilitySymfony?color=00a7a7)](https://github.com/PHPCompatibility/PHPCompatibilitySymfony/blob/master/LICENSE)\n[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilitySymfony/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilitySymfony/actions/workflows/ci.yml)\n\n# PHPCompatibilitySymfony\n\nUsing PHPCompatibilitySymfony, you can analyse the codebase of a project using any of the [Symfony polyfill libraries](https://github.com/symfony?utf8=?\u0026q=polyfill), for PHP cross-version compatibility.\n\n\n## What's in this repo ?\n\nA set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Symfony polyfill libraries.\n\nThese rulesets prevent false positives from the [PHPCompatibility standard](https://github.com/PHPCompatibility/PHPCompatibility) by excluding back-fills and poly-fills which are provided by those libraries.\n\nSymfony Polyfill Library | Corresponding PHPCompatibility Ruleset | Includes\n--- | --- | ---\n[`polyfill-php54`](https://github.com/symfony/polyfill-php54) | `PHPCompatibilitySymfonyPolyfillPHP54` |\n[`polyfill-php55`](https://github.com/symfony/polyfill-php55) | `PHPCompatibilitySymfonyPolyfillPHP55` | [`PHPCompatibilityPasswordCompat`](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat)\n[`polyfill-php56`](https://github.com/symfony/polyfill-php56) | `PHPCompatibilitySymfonyPolyfillPHP56` |\n[`polyfill-php70`](https://github.com/symfony/polyfill-php70) | `PHPCompatibilitySymfonyPolyfillPHP70` | [`PHPCompatibilityParagonieRandomCompat`](https://github.com/PHPCompatibility/PHPCompatibilityParagonie)\n[`polyfill-php71`](https://github.com/symfony/polyfill-php71) | `PHPCompatibilitySymfonyPolyfillPHP71` |\n[`polyfill-php72`](https://github.com/symfony/polyfill-php72) | `PHPCompatibilitySymfonyPolyfillPHP72` |\n[`polyfill-php73`](https://github.com/symfony/polyfill-php73) | `PHPCompatibilitySymfonyPolyfillPHP73` |\n[`polyfill-php74`](https://github.com/symfony/polyfill-php74) | `PHPCompatibilitySymfonyPolyfillPHP74` |\n[`polyfill-php80`](https://github.com/symfony/polyfill-php80) | `PHPCompatibilitySymfonyPolyfillPHP80` |\n\n\u003e About \"Includes\":\n\u003e Some polyfills have other polyfills as dependencies. If the PHPCompatibility project offers a dedicated ruleset for the polyfill dependency, that ruleset will be included in the ruleset for the higher level polyfill.\n\u003e\n\u003e For example:\n\u003e As the `polyfill-php70` library declares `random_compat` [as a dependency](https://github.com/symfony/polyfill-php70/blob/master/composer.json), the `PHPCompatibilitySymfonyPolyfillPHP70` ruleset includes the `PHPCompatibilityParagonieRandomCompat` ruleset.\n\u003e\n\u003e In practice, this means that if your project uses several polyfills, you can use the information in \"Includes\" to help you decide which rulesets to use.\n\n\n## Requirements\n\n* [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer).\n    * PHP 5.3+ for use with [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) 2.3.0+.\n    * PHP 5.4+ for use with [PHP_CodeSniffer](https://github.com/PHPCSStandards/PHP_CodeSniffer) 3.0.2+.\n\n    Use the latest stable release of PHP_CodeSniffer for the best results.\n    The minimum _recommended_ version of PHP_CodeSniffer is version 2.6.0.\n* [PHPCompatibility](https://github.com/PHPCompatibility/PHPCompatibility) 9.0.0+.\n* [PHPCompatibilityParagonie](https://github.com/PHPCompatibility/PHPCompatibilityParagonie) 1.0.0+.\n* [PHPCompatibilityPasswordCompat](https://github.com/PHPCompatibility/PHPCompatibilityPasswordCompat) 1.0.0+.\n\n\n## Installation instructions\n\nThe only supported installation method is via [Composer](https://getcomposer.org/).\n\nIf you don't have a Composer plugin installed to manage the `installed_paths` setting for PHP_CodeSniffer, run the following from the command-line:\n```bash\ncomposer config allow-plugins.dealerdirect/phpcodesniffer-composer-installer true\ncomposer require --dev dealerdirect/phpcodesniffer-composer-installer:\"^0.7\" phpcompatibility/phpcompatibility-symfony:\"*\"\n```\n\nIf you already have a Composer PHP_CodeSniffer plugin installed, run:\n```bash\ncomposer require --dev phpcompatibility/phpcompatibility-symfony:\"*\"\n```\n\nNext, run:\n```bash\nvendor/bin/phpcs -i\n```\nIf all went well, you will now see that the PHPCompatibility and a range of PHPCompatibilitySymfony and other PHPCompatibility standards are installed for PHP_CodeSniffer.\n\n\n## How to use\n\nNow you can use the following commands to inspect the code in your project for PHP cross-version compatibility:\n```bash\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP54\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP55\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP56\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP70\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP71\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP72\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP73\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP74\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP80\n\n# You can also combine the standards if your project uses several:\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP55,PHPCompatibilitySymfonyPolyfillPHP70,PHPCompatibilitySymfonyPolyfillPHP73\n```\n\nBy default, you will only receive notifications about deprecated and/or removed PHP features.\n\nTo get the most out of the PHPCompatibilitySymfony rulesets, you should specify a `testVersion` to check against. That will enable the checks for both deprecated/removed PHP features as well as the detection of code using new PHP features.\n\nFor example:\n```bash\n# For a project which should be compatible with PHP 5.3 up to and including PHP 7.0:\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP56 --runtime-set testVersion 5.3-7.0\n\n# For a project which should be compatible with PHP 7.2 and higher:\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP73 --runtime-set testVersion 7.2-\n```\n\nFor 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.\n\n\n### Testing PHP files only\n\nBy 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:\n```bash\n./vendor/bin/phpcs -p . --standard=PHPCompatibilitySymfonyPolyfillPHP71 --extensions=php --runtime-set testVersion 5.3-\n```\n\n## License\n\nAll code within the PHPCompatibility organisation is released under the GNU Lesser General Public License (LGPL). For more information, visit https://www.gnu.org/copyleft/lesser.html\n\n\n## Changelog\n\n### 1.2.2 - 2025-01-16\n\nThis is a maintenance release.\n\n- The recommended version of the [Composer PHPCS plugin] is now `^1.0.0`.\n- README: Fixed some broken badges.\n- General housekeeping and maintenance. Including a contribution by [@fredden].\n\n### 1.2.1 - 2022-10-23\n\n* `PHPCompatibilitySymfonyPolyfillPHP80` ruleset: allow for polyfilled `PhpToken` class, which was added in `polyfill-php80` version `1.25.0`.\n* README: Updated the installation instructions for [compatibility with Composer \u003e= 2.2][composer22announce].\n* Composer: The package will now identify itself as a static analysis tool. Thanks [@GaryJones]!\n* Other housekeeping and minor documentation updates.\n\n[composer22announce]: https://blog.packagist.com/composer-2-2/#more-secure-plugin-execution\n\n### 1.2.0 - 2021-02-16\n\n* Added new `PHPCompatibilitySymfonyPolyfillPHP80` ruleset.\n* The recommended version of the [Composer PHPCS plugin] is now `^0.7.0`, which offers compatibility with Composer 2.0.\n* The rulesets are now also tested against PHP 7.4 and 8.0.\n    Note: full PHP 7.4 support is only available in combination with PHP_CodeSniffer \u003e= 3.5.6.\n    Note: runtime PHP 8.0 support is only available in combination with PHP_CodeSniffer \u003e= 3.5.7, full support is expected in PHP_CodeSniffer 3.6.0.\n\n### 1.1.3 - 2020-07-19\n\n* `PHPCompatibilitySymfonyPolyfillPHP72` ruleset: allow for four polyfilled `PHP_FLOAT_*` constants, which were added in `polyfill-php72` version `1.16.0`.\n\n### 1.1.2 - 2020-05-20\n\n* `PHPCompatibilitySymfonyPolyfillPHP56` ruleset: allow for two polyfilled LDAP constants (undocumented in the Polyfill docs)\n* Composer: The recommended version of the [Composer PHPCS plugin] has been upped to `^0.6.0`.\n\n### 1.1.1 - 2019-08-30\n\n* `PHPCompatibilitySymfonyPolyfillPHP72` ruleset: minor tweak to prevent false positive when the sniffs are run over the polyfill itself.\n* Minor bug fix in the integration test for the `PHPCompatibilitySymfonyPolyfillPHP72` ruleset.\n\n### 1.1.0 - 2019-08-29\n\n* Added new `PHPCompatibilitySymfonyPolyfillPHP74` ruleset.\n* Updated the `PHPCompatibilitySymfonyPolyfillPHP73` ruleset to allow for the stub for the `JsonException` class which was added in `polyfill-php73` version `1.11.0`.\n* Composer: The recommended version of the [Composer PHPCS plugin] has been upped to `^0.5.0`.\n* CI: Added early warning system for false positives due to changes in the polyfill libraries themselves.\n\n### 1.0.1 - 2018-12-16\n\n* Prevent false positives when the ruleset is run over the code of the polyfills themselves.\n* The rulesets are now also tested against PHP 7.3.\n    Note: full PHP 7.3 support is only available in combination with PHP_CodeSniffer 2.9.2 or 3.3.1+ due to an incompatibility within PHP_CodeSniffer itself.\n\n### 1.0.0 - 2018-10-07\n\nInitial release of PHPCompatibilitySymfony containing rulesets covering the `polyfill-php*` libraries.\n\n[Composer PHPCS plugin]: https://github.com/PHPCSStandards/composer-installer/\n\n[@fredden]:   https://github.com/fredden\n[@GaryJones]: https://github.com/GaryJones\n","funding_links":["https://opencollective.com/php_codesniffer","https://github.com/sponsors/PHPCompatibility","https://github.com/sponsors/jrfnl"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpcompatibility%2Fphpcompatibilitysymfony","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpcompatibility%2Fphpcompatibilitysymfony","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpcompatibility%2Fphpcompatibilitysymfony/lists"}