Download the PHP package gpalab/coding-standards without Composer

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

GPA Lab PHP Code Standards

This collection of PHP CodeSniffer rules helps ensure consistency across PHP projects developed and managed by the GPA Lab. It helps to maintain a high level of code quality and standardizes the team's approach to PHP projects.

The repository contains two ruleset:

Rulesets

General Projects

The GPA Lab Standard ruleset is a general set of rule applicable to any PHP project. In order to utilize these standards, you will need to install the following dependencies into your project:

The recommended way to install these dependencies is to add them to the development requirements listed in your project's composer.json file. The result will look something like this:

With this done, run composer install to install the dependencies to your project.

Once installed, you will need to identify which ruleset PHP Code Sniffer should utilize. The easiest way to do so is by adding a PHP Code Sniffer configuration file such as .phpcs.xml to the root of your project. In this file, use the rule tag to reference the GPA Lab standard ruleset using the key GPA-Lab. The result will look something like this:

WordPress Projects

This repository also contains a ruleset for use with WordPress projects (such as plugins and themes). In addition to the PHP best practice and style rules in the standard ruleset, this ruleset includes Wordpress-specific rules and best practices.

The process for installing the WordPress ruleset is largely the same. However, since we are extending the WordPress ruleset, you will also need to install the following peer dependencies: php-compatibility, phpcompatibility-wp, and wp-coding-standards/wpcs. The resulting composer.json file will look like this:

Your PHP Code Sniffer configuration file will look the same, except that you should use the GPA-Lab-WordPress reference key rather than the GPA-Lab key.

Usage

CI

Often times, the easiest way to run PHP Code Sniffer in a continuous integration context is by adding an NPM script to execute the test. For example:

This script requires that PHP Code Sniffer is installed into the project's vendor directory, so make sure that you run composer install or composer update before executing this command.

Note: The -n flag indicates that warnings should be omitted.

VSCode

There are a number of ways to integrate PHP Code Sniffer into your local IDE. For VSCode, we have found that the combination of these two extensions works best:

Thanks

This project owes a huge debt to the WordPress Coding Standards project, which provided both inspiration and a sane set of defaults on which we were able to build.


All versions of coding-standards with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
squizlabs/php_codesniffer Version ^3.12.2
phpcsstandards/phpcsextra Version ^1.2.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 gpalab/coding-standards contains the following files

Loading the files please wait ...