2017 © Pedro Peláez
 

library php-code-quality

Quality assurance toolchain

image

jasny/php-code-quality

Quality assurance toolchain

  • Wednesday, June 20, 2018
  • by jasny
  • Repository
  • 0 Watchers
  • 3 Stars
  • 4,888 Installations
  • PHP
  • 24 Dependents
  • 0 Suggesters
  • 3 Forks
  • 1 Open issues
  • 14 Versions
  • 11 % Grown

The README.md

PHP code quality

Coding standard

Adhere to the PSR-12 coding standard., (*1)

Installation

All PHP projects of Jasny should include this package. It can be installed through composer., (*2)

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., (*3)

Copy the PHPUnit configuration into the projects root folder, (*4)

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., (*5)

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., (*6)

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

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., (*8)

Copy the PHPStan configuration to the project root folder, (*9)

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

Composer scripts

Composer can be configured to run all tests, (*10)

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

To run all tests do, (*11)

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., (*12)

GitHub actions

GitHub actions will run all unit tests on each pull-request and push to the master branch., (*13)

Copy the github folder from the php-code-quality directory., (*14)

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., (*15)

The Versions

20/06 2018

dev-master

9999999-dev

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

23/04 2018

v2.3.0

2.3.0.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

22/04 2018

v2.2.1

2.2.1.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

16/04 2018

v2.2.0

2.2.0.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

24/01 2017

v2.1.3

2.1.3.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

28/12 2016

v2.1.2

2.1.2.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

27/12 2016

v2.1.1

2.1.1.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

27/12 2016

v2.1.0

2.1.0.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

07/10 2016

v2.0.0

2.0.0.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

28/11 2015

v1.2.0

1.2.0.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

07/09 2015

v1.1.2

1.1.2.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

07/09 2015

v1.1.1

1.1.1.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

07/09 2015

v1.1.0

1.1.0.0

Quality assurance toolchain

  Sources   Download

MIT

The Requires

 

17/08 2015