Download the PHP package magento/magento-coding-standard without Composer

On this page you can find all versions of the php package magento/magento-coding-standard. 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 magento-coding-standard

Magento Coding Standard

A set of Magento rules for PHP_CodeSniffer tool.

Installation within a Magento 2 site

To use within your Magento 2 project you can use:

Due to security, when installed this way the Magento standard for phpcs cannot be added automatically. You can achieve this by adding the following to your project's composer.json:

Installation for development

You can install Magento Coding Standard by cloning this GitHub repo:

It is possible also to install a standalone application via Composer

Verify installation

Command should return the list of installed coding standards including Magento2.

Usage

Once installed, you can run phpcs from the command-line to analyze your code MyAwesomeExtension

Fixing issues automatically

Also, you can run phpcbf from the command-line to fix your code MyAwesomeExtension for warnings like "PHPCBF CAN FIX THE [0-9]+ MARKED SNIFF VIOLATIONS AUTOMATICALLY"

Contribution

See the community contribution model.

Where to contribute

How to contribute

1) Start with looking into Community Dashboard. Any ticket in Up for grabs is a good candidate to start. 2) Didn't satisfy your requirements? Create one of three types of issues:

Testing

All rules should be covered by unit tests. Each Test.php class should be accompanied by a Test.inc file to allow for unit testing based upon the PHP_CodeSniffer parent class AbstractSniffUnitTest. You can verify your code by running

Also, verify that the sniffer code itself is written according to the Magento Coding Standard:

ESLint

Prerequisites: Node.js (^12.22.0, ^14.17.0, or >=16.0.0).

You need to run the following command to install all the necessary packages described in the package.json file:

You can execute ESLint as follows:

RECTOR PHP

From magento-coding-standard project, you can execute rector php as follows:

The rules from rector that are applied are set inside the config file: rector.php

The option --dry-run displays errors found, but code is not automatically fixed.

To run rector for magento projects you need to:

Example:

License

Each Magento source file included in this distribution is licensed under the OSL-3.0 license.

Please see LICENSE.txt for the full text of the Open Software License v. 3.0 (OSL-3.0).


All versions of magento-coding-standard with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
webonyx/graphql-php Version ^15.0
ext-simplexml Version *
ext-dom Version *
squizlabs/php_codesniffer Version ^3.6.1
rector/rector Version ^1.2.4
phpcsstandards/phpcsutils Version ^1.0.5
magento/php-compatibility-fork Version ^0.1
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 magento/magento-coding-standard contains the following files

Loading the files please wait ....