Download the PHP package syde/phpcs without Composer

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

Latest Stable Version License PHP Version Require PHP Quality Assurance Status

Syde PHP Coding Standards

Syde PHP coding standards for WordPress projects.

This package contains PHP_CodeSniffer sniffs and rulesets to validate code developed for WordPress projects. It ensures code quality and adherence to coding conventions, especially the official WordPress Coding Standards, as well as select best practices from the wider web development and PHP industries.


Table of Contents


Requirements

The Syde PHP Coding Standards package requires:

When installed for local development, these packages will be installed as well:

Installation

Installing this package with Composer will automatically install all required dependencies, and register the rulesets from the Syde PHP Coding Standards and other external standards with PHP_CodeSniffer using the PHP_CodeSniffer Standards Composer Installer Plugin.

Local Installation

To install the Syde PHP Coding Standards, execute the following commands from the root of your project:

Global Installation

Alternatively, you can also install the Syde PHP Coding Standards globally:

Verify Installation

You can verify the installation by executing the following command:

This should display something like the following, including the Syde PHP Coding Standards (bold):

The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, Syde, Syde-Core, Syde-Extra, Syde-Templates, WordPress-VIP-Go, WordPressVIPMinimum, PHPCompatibility, Modernize, NormalizedArrays, Universal, PHPCSUtils, VariableAnalysis, SlevomatCodingStandard, WordPress, WordPress-Core, WordPress-Docs and WordPress-Extra

Rulesets

This package contains four rulesets:

Usage

Command Line

Once the package has been installed via Composer, you can run the phpcs command-line tool on a given file or directory using the desired Syde PHP Coding Standard.

For example, this is how you can check a third-party plugin for minimum required rules only:

Using the full Syde standard for a specific file would look like so:

For more information on PHP_CodeSniffer usage, refer to the documentation in the PHP_CodeSniffer Wiki.

Custom Ruleset

Like any other PHP_CodeSniffer standard, you can add the Syde PHP Coding Standard(s) to a custom PHP_CodeSniffer ruleset (e.g., a phpcs.xml.dist file).

A minimum working example could look like so:

Using a custom ruleset avoids passing many arguments via the command line, and at the same time ensures consistent usage. All you have to do then is to run the phpcs command-line tool:

Any argument or option you pass, will overwrite what's been defined in the custom ruleset.

Here is a real-world example including files and folders to check, as well as some PHP_CodeSniffer and ruleset configuration:

For more information, take a look at Using a Default Configuration File and the Annotated Ruleset pages in the PHP_CodeSniffer Wiki.

Customization

The Syde PHP Coding Standards contain a number of sniffs that are configurable. This means that you can turn parts of the sniff on or off, or change the behavior by setting a property for the sniff in your custom ruleset file.

You can find a complete list of all the properties you can change for the Syde PHP Coding Standards in the list of all sniffs.

Auto-Fixing

The Syde PHP Coding Standards include several sniffs that support automatic fixing of coding standard violations. These sniffs are marked with the 🔧 symbol in the list of all sniffs. To fix your code automatically, run the phpcbf command-line tool instead of phpcs:

Always remember to back up your code before performing automatic fixes. Also, make sure to manually check the updated code as the automatic fixer can sometimes produce unwanted results.

Disabling or Excluding Rules

For information about disabling or excluding rules, refer to the Disabling or Excluding Rules page in the docs/ folder.

IDE Integration

For information about IDE integration (currently PhpStorm only), refer to the IDE Integration page in the docs/ folder.

Migrating from Inpsyde to Syde PHP Coding Standards

In case you are already using the Inpsyde PHP Coding Standards (version 1 or 2) and want to migrate to the Syde PHP Coding Standards, refer to the Migration page in the docs/ folder.

Crafted by Syde

The team at Syde is engineering the Web since 2006.

Copyright and License

This package is free software distributed under the terms of the GNU General Public License version 2 or (at your option) any later version. For the full license, see LICENSE.

Contributing

All contributions are very welcome. Please read the CONTRIBUTING documentation to get started.

By contributing code, you grant its use under the current license (see LICENSE).


All versions of phpcs with dependencies

PHP Build Version
Package Version
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 syde/phpcs contains the following files

Loading the files please wait ....