Download the PHP package dealerdirect/phpcodesniffer-composer-installer without Composer

On this page you can find all versions of the php package dealerdirect/phpcodesniffer-composer-installer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package phpcodesniffer-composer-installer

PHP_CodeSniffer Standards Composer Installer Plugin

Last Commit Awesome

Tests Latest Version on Packagist Packagist

This composer installer plugin allows for easy installation of PHP_CodeSniffer coding standards (rulesets).

No more symbolic linking of directories, checking out repositories on specific locations or changing the phpcs configuration.

Usage

Installation can be done with 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 composer.json file by Composer:

When using Composer < 2.2, you can add the permission flag ahead of the upgrade to Composer 2.2, by running:

That's it.

Compatibility

This plugin is compatible with:

How it works

Basically, this plugin executes the following steps:

Example project

The following is an example Composer project and has included multiple phpcodesniffer-standard packages.

After running composer install PHP_CodeSniffer just works:

Calling the plugin directly

In some circumstances, it is desirable to call this plugin's functionality directly. For instance, during development or in CI environments.

As the plugin requires Composer to work, direct calls need to be wired through a project's composer.json.

This is done by adding a call to the Plugin::run function in the script section of the composer.json:

The command can then be called using composer run-script install-codestandards or referenced from other script configurations, as follows:

For more details about Composer scripts, please refer to the section on scripts in the Composer manual.

Changing the Coding Standards search depth

By 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.

Caveats

When 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, it could potentially confuse as another version of the plugin could be run and not the one specified by the project.

Developing Coding Standards

Coding standard can be developed normally, as documented by PHP_CodeSniffer, in the Coding Standard Tutorial.

Create a composer package of your coding standard by adding a composer.json file.

Requirements:

Requiring the plugin from within your coding standard

If 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 installed_paths, as well as simplify your standard's installation instructions.

For this to work, make sure your external standard adds this plugin to the composer.json config via require, not require-dev.

:warning: Your end-user may already require-dev this plugin and/or other external standards used by your end-users may require this plugin as well.

To prevent your end-users getting into "dependency hell", make sure to make the version requirement for this plugin flexible.

Remember that Composer treats unstable minors as majors and will not be able to resolve one config requiring this plugin at version ^0.7, while another requires it at version ^1.0. Either allow multiple minors or use * as the version requirement.

Some examples of flexible requirements which can be used:

Changelog

This repository does not contain a CHANGELOG.md file, however, we do publish a changelog on each release using the GitHub releases functionality.

Contributing

This 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.

Thank you for being involved! :heart_eyes:

Authors & contributors

The original idea and setup of this repository is by Franck Nijhof, employee @ Dealerdirect.

For a full list of all author and/or contributors, check the contributors page.

Funding

This project is included in the projects supported via the PHP_CodeSniffer Open Collective.

If you use this plugin, financial contributions to the Open Collective are encouraged and appreciated.

License

The 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.


All versions of phpcodesniffer-composer-installer with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4
composer-plugin-api Version ^1.0 || ^2.0
squizlabs/php_codesniffer Version ^2.0 || ^3.1.0 || ^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dealerdirect/phpcodesniffer-composer-installer contains the following files

Loading the files please wait ....