{"id":19932018,"url":"https://github.com/phpcompatibility/phpcompatibilityparagonie","last_synced_at":"2025-05-03T11:30:53.048Z","repository":{"id":33106749,"uuid":"148994835","full_name":"PHPCompatibility/PHPCompatibilityParagonie","owner":"PHPCompatibility","description":"PHPCompatibility rulesets which can be included in projects using the Paragonie polyfill libraries","archived":false,"fork":false,"pushed_at":"2024-04-24T21:35:29.000Z","size":83,"stargazers_count":9,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-05-01T11:39:53.793Z","etag":null,"topics":["paragonie-polyfill-libraries","php","php-codesniffer","phpcompatibility","phpcs-standard"],"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:46:25.000Z","updated_at":"2024-06-18T17:04:14.205Z","dependencies_parsed_at":"2023-11-14T01:23:58.714Z","dependency_job_id":"1d87586c-66de-427a-81a9-ba96dcfc0fc3","html_url":"https://github.com/PHPCompatibility/PHPCompatibilityParagonie","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%2FPHPCompatibilityParagonie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilityParagonie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilityParagonie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PHPCompatibility%2FPHPCompatibilityParagonie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PHPCompatibility","download_url":"https://codeload.github.com/PHPCompatibility/PHPCompatibilityParagonie/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":["paragonie-polyfill-libraries","php","php-codesniffer","phpcompatibility","phpcs-standard"],"created_at":"2024-11-12T23:08:46.719Z","updated_at":"2025-05-03T11:30:53.034Z","avatar_url":"https://github.com/PHPCompatibility.png","language":"PHP","readme":"[![Latest Stable Version](https://img.shields.io/packagist/v/phpcompatibility/phpcompatibility-paragonie?label=stable)](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie)\n[![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcompatibility/phpcompatibility-paragonie)\n[![License](https://img.shields.io/github/license/PHPCompatibility/PHPCompatibilityParagonie?color=00a7a7)](https://github.com/PHPCompatibility/PHPCompatibilityParagonie/blob/master/LICENSE)\n[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilityParagonie/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilityParagonie/actions/workflows/ci.yml)\n\n# PHPCompatibilityParagonie\n\nUsing PHPCompatibilityParagonie, you can analyse the codebase of a project using either of the Paragonie polyfills, for PHP cross-version compatibility.\n\n\n## What's in this repo ?\n\nTwo rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie 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\nParagonie Polyfill Library | Corresponding PHPCompatibility Ruleset | Includes\n--- | --- | ---\n[`random_compat`](https://github.com/paragonie/random_compat) | `PHPCompatibilityParagonieRandomCompat`\n[`sodium_compat`](https://github.com/paragonie/sodium_compat) | `PHPCompatibilityParagonieSodiumCompat` | `PHPCompatibilityParagonieRandomCompat`\n\n\u003e Note:\n\u003e As the `sodium_compat` library has `random_compat` [as a dependency](https://github.com/paragonie/sodium_compat/blob/master/composer.json), the `PHPCompatibilityParagonieSodiumCompat` ruleset includes the `PHPCompatibilityParagonieRandomCompat` ruleset.\n\u003e\n\u003e In practice, this means that if your project uses both libraries, you just need to use the `PHPCompatibilityParagonieSodiumCompat` ruleset to prevent false positives from both.\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\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-paragonie:\"*\"\n```\n\nIf you already have a Composer PHP_CodeSniffer plugin installed, run:\n```bash\ncomposer require --dev phpcompatibility/phpcompatibility-paragonie:\"*\"\n```\n\nNext, run:\n```bash\nvendor/bin/phpcs -i\n```\nIf all went well, you will now see that the `PHPCompatibility`, `PHPCompatibilityParagonieRandomCompat` and `PHPCompatibilityParagonieSodiumCompat` 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=PHPCompatibilityParagonieRandomCompat\n\n./vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieSodiumCompat\n```\n\nBy default, you will only receive notifications about deprecated and/or removed PHP features.\n\nTo get the most out of the PHPCompatibilityParagonie 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=PHPCompatibilityParagonieRandomCompat --runtime-set testVersion 5.3-7.0\n\n# For a project which should be compatible with PHP 5.4 and higher:\n./vendor/bin/phpcs -p . --standard=PHPCompatibilityParagonieSodiumCompat --runtime-set testVersion 5.4-\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=PHPCompatibilityParagonieRandomCompat --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.3.3 - 2024-04-25\n\n* Prevent a new false positive when the ruleset is run over the code of the latest 1.x version of the `sodium_compat` polyfill itself.\n* The recommended version of the [Composer PHPCS plugin] is now `^1.0`.\n* Other housekeeping. Includes a contribution from [@fredden].\n\n### 1.3.2 - 2022-10-25\n\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.3.1 - 2021-02-15\n\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.3.0 - 2019-11-04\n\n* Ruleset update for full compatibility with version [`1.12.0` of `sodium_compat`](https://github.com/paragonie/sodium_compat/releases/tag/v1.12.0).\n\n### 1.2.0 - 2019-10-16\n\n* Ruleset update for full compatibility with version [`1.11.0` of `sodium_compat`](https://github.com/paragonie/sodium_compat/releases/tag/v1.11.0).\n\n### 1.1.0 - 2019-08-29\n\n* The `PHPCompatibilityParagonieSodiumCompat` ruleset has been updated to account for the latest changes in the `sodium_compat` polyfill.\n* Prevent false positives when the ruleset is run over the code of the `sodium_compat` polyfill itself.\n* Composer: The recommended version of the [Composer PHPCS plugin] has been upped to `^0.5.0`.\n* CI: Improved integration test for the `SodiumCompat` ruleset.\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 `random_compat` polyfill itself.\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 PHPCompatibilityParagonie containing rulesets covering the `random_compat` and `sodium_compat` polyfill 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%2Fphpcompatibilityparagonie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphpcompatibility%2Fphpcompatibilityparagonie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphpcompatibility%2Fphpcompatibilityparagonie/lists"}