Download the PHP package jasny/php-code-quality without Composer

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

PHP code quality

Coding standard

Adhere to the PSR-12 coding standard.

Installation

All PHP projects of Jasny should include this package. It can be installed through composer.

composer require --dev jasny/php-code-quality

Toolchain

PHPUnit

PHPUnit is a programmer-oriented testing framework for PHP. The unit tests should be in the tests directory.

Copy the PHPUnit configuration into the projects root folder

cp vendor/jasny/php-code-quality/phpunit.xml.dist .

vfsStream

vfsStream is a stream wrapper for a virtual file system that may be helpful in unit tests to mock the real file system.

PHP CodeSniffer

phpcs tokenises PHP files and detects violations of a defined set of coding standards. It is an essential development tool that ensures your code remains clean and consistent.

This package comes with a custom ruleset which embodies the Jasny PHP coding standard, which should be copied to the project root folder.

cp vendor/jasny/php-code-quality/phpcs.xml.dist phpcs.xml

PHPStan

PHPStan is a static code analysis tool. It moves PHP closer to compiled languages in the sense that the correctness of each line of the code can be checked before you run the actual line.

Copy the PHPStan configuration to the project root folder

cp vendor/jasny/php-code-quality/phpstan.neon.dist phpstan.neon

Composer scripts

Composer can be configured to run all tests

"scripts": {
    "test": [
        "phpunit",
        "phpstan analyse",
        "phpcs -p src"
    ]
},
"scripts-descriptions": {
    "test": "Run all tests and quality checks"
}

To run all tests do

composer run-script test

Services

Open source projects should all of these quality assurance services. Closed source project may use a single service to both run tests and code quality checks in order to save costs.

GitHub actions

GitHub actions will run all unit tests on each pull-request and push to the master branch.

Copy the github folder from the php-code-quality directory.

cp -r vendor/jasny/php-code-quality/github .github

Scrutinizer

Scrutinizer tests code quality using PHP CodeSniffer, PHPStan and a custom analysis tool from Scrutinizer. It also collects tests coverage results.


All versions of php-code-quality with dependencies

PHP Build Version
Package Version
Requires phpunit/phpunit Version >= 8.0, < 12.0
mikey179/vfsstream Version ^1.6
squizlabs/php_codesniffer Version ^3.10
phpstan/phpstan Version >= 0.11.0, < 2.0.0
phpstan/phpstan-strict-rules Version >= 0.11.0, < 2.0.0
jasny/phpunit-extension Version ^0.4.0
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 jasny/php-code-quality contains the following files

Loading the files please wait ....