Recommend this page to a friend! |
Classes of Adeleye Ayodeji | Download Installed Plugin | vendor/dealerdirect/phpcodesniffer-composer-installer/README.md | Download |
|
DownloadPHP_CodeSniffer Standards Composer Installer Plugin![Project Stage][project-stage-shield] ![Last Commit][last-updated-shield] ![Awesome][awesome-shield] [![License][license-shield]](LICENSE.md) [![Tests][ghactionstest-shield]][ghactions] [![Latest Version on Packagist][packagist-version-shield]][packagist-version] [![Packagist][packagist-shield]][packagist] [![Contributor Covenant][code-of-conduct-shield]][code-of-conduct] This composer installer plugin allows for easy installation of [PHP_CodeSniffer][codesniffer] coding standards (rulesets). No more symbolic linking of directories, checking out repositories on specific locations or changing
the UsageInstallation can be done with [Composer][composer], by requiring this package as a development dependency:
When using Composer 2.2 or higher, Composer will ask for your permission to allow this plugin to execute code. For this plugin to be functional, permission needs to be granted. When permission has been granted, the following snippet will automatically be added to your
When using Composer < 2.2, you can add the permission flag ahead of the upgrade to Composer 2.2, by running:
That's it. CompatibilityThis plugin is compatible with:
> ?? Please Note: [Composer treats _minor_ releases below 1.0.0 as _major_ releases][composer-manual-caret]. So version How it worksBasically, this plugin executes the following steps:
Example projectThe following is an example Composer project and has included
multiple
After running
Calling the plugin directlyIn some circumstances, it is desirable to call this plugin's functionality directly. For instance, during development or in [CI][definition-ci] environments. As the plugin requires Composer to work, direct calls need to be wired through a
project's This is done by adding a call to the
The command can then be called using
For more details about Composer scripts, please refer to [the section on scripts in the Composer manual][composer-manual-scripts]. Changing the Coding Standards search depthBy default, this plugin searches up for Coding Standards up to three directories deep. In most cases, this should be sufficient. However, this plugin allows you to customize the search depth setting if needed.
CaveatsWhen this plugin is installed globally, composer will load the _global_ plugin rather than the one from the local repository. Despite [this behavior being documented in the composer manual][using-composer-plugins], it could potentially confuse as another version of the plugin could be run and not the one specified by the project. Developing Coding StandardsCoding standard can be developed normally, as documented by [PHP_CodeSniffer][codesniffer], in the [Coding Standard Tutorial][tutorial]. Create a composer package of your coding standard by adding a
Requirements:
* The repository may contain one or more standards.
* Each standard can have a separate directory no deeper than 3 levels from the repository root.
* The package Requiring the plugin from within your coding standardIf your coding standard itself depends on additional external PHPCS standards, this plugin can make life easier on your end-users by taking care of the installation of all standards - yours and your dependencies - for them. This can help reduce the number of support questions about setting the For this to work, make sure your external standard adds this plugin to the > :warning: Your end-user may already ChangelogThis repository does not contain a ContributingThis is an active open-source project. We are always open to people who want to use the code or contribute to it. We've set up a separate document for our [contribution guidelines][contributing-guidelines]. Thank you for being involved! :heart_eyes: Authors & contributorsThe original idea and setup of this repository is by [Franck Nijhof][frenck], employee @ Dealerdirect. For a full list of all author and/or contributors, check [the contributors page][contributors]. LicenseThe MIT License (MIT) Copyright (c) 2016-2022 Dealerdirect B.V. and contributors Copyright (c) 2022 PHPCSStandards and contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. [awesome-shield]: https://img.shields.io/badge/awesome%3F-yes-brightgreen.svg
[changelog]: https://github.com/PHPCSStandards/composer-installer/releases
[code-of-conduct-shield]: https://img.shields.io/badge/Contributor%20Covenant-v2.0-ff69b4.svg
[code-of-conduct]: CODE_OF_CONDUCT.md
[codesniffer]: https://github.com/squizlabs/PHP_CodeSniffer
[composer-manual-scripts]: https://getcomposer.org/doc/articles/scripts.md
[composer-manual-caret]: https://getcomposer.org/doc/articles/versions.md#caret-version-range-
[composer]: https://getcomposer.org/
[contributing-guidelines]: CONTRIBUTING.md
[contributors]: https://github.com/PHPCSStandards/composer-installer/graphs/contributors
[definition-ci]: https://en.wikipedia.org/wiki/Continuous_integration
[frenck]: https://github.com/frenck
[last-updated-shield]: https://img.shields.io/github/last-commit/PHPCSStandards/composer-installer.svg
[license-shield]: https://img.shields.io/github/license/PHPCSStandards/composer-installer.svg
[packagist-shield]: https://img.shields.io/packagist/dt/dealerdirect/phpcodesniffer-composer-installer.svg
[packagist-version-shield]: https://img.shields.io/packagist/v/dealerdirect/phpcodesniffer-composer-installer.svg
[packagist-version]: https://packagist.org/packages/dealerdirect/phpcodesniffer-composer-installer
[packagist]: https://packagist.org/packages/dealerdirect/phpcodesniffer-composer-installer
[ |