Download the PHP package pdga/coding-standards without Composer

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

The src/ruleset.xml file in this directory is the rule set for PDGA coding standards.

Adding to a repository

Note: If any section already exists, add the new information under/inside of it.

Using in a repository

Once you have the repository's composer.json file set up and have run composer install to install the new dependency, you can run using composer run and choose either sniff, format or format-verbose.

Running Unit Tests

From the root directory, run bin/phpunit.

VSCode Plugin Setup

Clone main repo

git clone https://github.com/PDGA/coding-standards.git

cd coding-standards && ./bin/composer install

Plugin

Set up VSCode with this plugin: https://marketplace.visualstudio.com/items?itemName=ValeryanM.vscode-phpsab

Add the JSON configuration below to your settings.json file, usually in:

Note: you will have to change the path to where you cloned coding-standards.

Thus, if you installed it at ~/Code/coding-standards, the full path on a Mac would be /Users/<username>/Code/coding-standards

Debugging the Codesniffer plugin configuration

To enable debugging, add to settings.json:

Then open Terminal -> New Terminal in vscode, after it opens click 'OUTPUT' and from the dropdown, choose PHP Sniffer & Beautifier.

Per Repo or VSC workspace specific configuration

Open the .code-workspace file for that workspace and add:

Disable

This should override the settings for that one workspace, turning off the file.

Rules

PhpStorm PHP_CodeSniffer Setup

PhpStorm has native support for configuring PHP_CodeSniffer as a Quality Tool per project.

Follow the setup instructions here: PhpStorm Setup

Configuring for a project that runs on a Docker image

The setup instructions will use a local PHP interpreter and local file paths for the CodeSniffer configuration. When setting this up for a project that runs within a Docker image, there are some things to be aware of. Since Composer commands should run on the image instead of locally, you will need everything configured from the perspective of the image.


All versions of coding-standards with dependencies

PHP Build Version
Package Version
Requires squizlabs/php_codesniffer Version 3.*
slevomat/coding-standard Version ^8.19
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 pdga/coding-standards contains the following files

Loading the files please wait ...