Download the PHP package zooroyal/coding-standard-source without Composer
On this page you can find all versions of the php package zooroyal/coding-standard-source. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package coding-standard-source
ZooRoyal Coding Standard Source
This repository holds the necessary sources to use and build the ZooRoyal Coding Standard.
It incorporates
- PHP Code Sniffer and its configuration
- PHP Copy Paste Detector
- PHP-Parallel-Lint
- PHPStan - PHP Static Analysis Tool and its configuration
- ES-LINT and its configuration
- STYLE-LINT and its configuration
In addition, there is a PHP script in src/bin to be used by a continuous integration tool of your choice. It searches your source code to find files to check with its static code analysis tools. Information about its usage can be found by calling it with -h option.
Installation (as intended)
Docker
The ZooRoyal Coding Standard is designed to be used as a docker isolated application. Therefore, no installation is needed if you have a docker daemon available on your system.
Composer
If ...
- ... you don't feel comfortable with the docker user experience ...
- ... want to bind your source code to a certain version of the ZooRoyal Coding Standard ...
... you find a ready-made composer package at https://github.com/ZooRoyal/coding-standard
It will still require you to have a docker daemon available on your system.
The ZooRoyal Coding Standard application will be available under
vendor/bin/coding-standard.
Install from source (not recommended)
If all else fails, you can install the ZooRoyal Coding Standard from this source package. Please be aware that this is not recommended. There will be tons of dependencies the rest of your project will have to comply with. They will be very specific and change as we see fit.
Standalone
If you want to use the ZooRoyal Coding Standard as a standalone application, you can use the following commands:
The ZooRoyal Coding Standard application will be available under
src/bin/coding-standard.
As composer dependency
To use the ZooRoyal Coding Standard as a composer dependency, you can require it via composer but this alone won't be enough. You will have to install the necessary tools as well. For this to happen, you can use the following process:
Now you need to add the following lines to your composer.json:
The final step is to install the necessary tools. This can be done by running the following command:
This will install the following tools in several directories under vendor-bin:
- PHPStan (composer.json)
- PHP-Parallel-Lint (composer.json)
- PHPCPD (composer.json)
- PHPMD (composer.json)
This tools will be installed in node_modules:
The ZooRoyal Coding Standard application will be available under
vendor/bin/coding-standard.
Usage ZooRoyal Coding Standard
Please keep in mind, that ZooRoyal Coding Standard can only check source code which is a git repository as well as a composer project
Using the docker image directly
If you want to use the docker image directly, you can use the following command:
This will mount your current working directory as the root directory of the source code you want to check.
For your convenience, you can create an alias for this command:
To use a certain version of the coding-standard, just add the version tag to the image name:
Using one of the composer packages
The composer package will install a script in your vendor/bin folder of your composer project
or src/bin of the standalone installation folder. Use them to run the
ZooRoyal Coding Standard.
The ZooRoyal Coding Standard application must be executed from the root of your project.
Using the ZooRoyal Coding Standard
Run the command to get usage instructions.
Example sca:all
The all command forwards all applicable parameters to all implemented static code analysis tools.
This command for example tries to find the parent branch by automagic (-a) and tells all static code analysis tools to fix found violations if they are able to.
This command computes the diff to the branch origin/master and searches for all violations in this files.
For examples just have a look an the .travis.yml
Extend the Coding Standard
If you want to extend the ZooRoyal Coding Standard with your own tools there are two tutorials available:
- How to add a new static code analysis tool
- Adding new information to your TerminalCommand
Integrating the Coding Standard into PHPStorm
If you want to integrate the ZooRoyal Coding Standard into PHPStorm, have a look at the guides in the doc/ideConfig folder.
All versions of coding-standard-source with dependencies
ext-json Version *
ext-xml Version *
composer-runtime-api Version ^2.0
bamarni/composer-bin-plugin Version ^1.8.2
composer/semver Version ^3.4.3
dealerdirect/phpcodesniffer-composer-installer Version ^1.0.0
nette/neon Version ^3.4.4
nette/utils Version ^4.0.5
nikic/php-parser Version ^5.4.0
php-di/php-di Version ^7.0.1
slevomat/coding-standard Version ^8.16.1
squizlabs/php_codesniffer Version ^3.12.0
symfony/console Version ^7.2.1
symfony/event-dispatcher Version ^7.2.0
symfony/filesystem Version ^7.2.0
symfony/process Version ^7.2.4
thecodingmachine/safe Version ^3.0.2
webmozart/path-util Version ^2.3