PHPackages                             jasny/php-code-quality - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. jasny/php-code-quality

AbandonedArchivedLibrary[Testing &amp; Quality](/categories/testing)

jasny/php-code-quality
======================

Quality assurance toolchain

v3.0.0(1y ago)713.0k↓50%4[1 issues](https://github.com/jasny/php-code-quality/issues)20MIT

Since Dec 23Pushed 1y agoCompare

[ Source](https://github.com/jasny/php-code-quality)[ Packagist](https://packagist.org/packages/jasny/php-code-quality)[ RSS](/packages/jasny-php-code-quality/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (6)Versions (32)Used By (20)

PHP code quality
================

[](#php-code-quality)

Coding standard
---------------

[](#coding-standard)

Adhere to the [PSR-12 coding standard](https://www.php-fig.org/psr/psr-12/).

Installation
------------

[](#installation)

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

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

```

Toolchain
---------

[](#toolchain)

### PHPUnit

[](#phpunit)

[PHPUnit](https://phpunit.de/) 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)

[vfsStream](https://github.com/mikey179/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

[](#php-codesniffer)

[phpcs](https://github.com/squizlabs/PHP_CodeSniffer) 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)

[PHPStan](https://github.com/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-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
--------

[](#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)

[GitHub actions](https://github.com/features/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)

[Scrutinizer](https://scrutinizer-ci.com/) tests code quality using PHP CodeSniffer, PHPStan and a custom analysis tool from Scrutinizer. It also collects tests coverage results.

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance31

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community21

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~44 days

Recently: every ~327 days

Total

31

Last Release

664d ago

Major Versions

v1.2.0 → v2.0.02020-12-23

v2.9.1 → v3.0.02024-07-23

PHP version history (5 changes)v2.1.0PHP &gt;=5.6

v2.2.0PHP ~7.0

v2.3.0PHP ~7.1

v2.3.6PHP &gt;=7.2.0

v2.7.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/3379a93d51305df325df9045e1a8b205d195e4e8c01312dff53a000ee79002eb?d=identicon)[jasny](/maintainers/jasny)

---

Top Contributors

[![jasny](https://avatars.githubusercontent.com/u/100821?v=4)](https://github.com/jasny "jasny (70 commits)")

### Embed Badge

![Health badge](/badges/jasny-php-code-quality/health.svg)

```
[![Health](https://phpackages.com/badges/jasny-php-code-quality/health.svg)](https://phpackages.com/packages/jasny-php-code-quality)
```

###  Alternatives

[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2021.0M277](/packages/drupal-core-dev)[wp-cli/wp-cli-tests

WP-CLI testing framework

422.7M87](/packages/wp-cli-wp-cli-tests)[youwe/testing-suite

Contains Youwe's default testing packages for php.

13176.9k8](/packages/youwe-testing-suite)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
