PHPackages                             jbzoo/codestyle - 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. jbzoo/codestyle

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

jbzoo/codestyle
===============

Collection of QA tools and JBZoo code standards

7.2.0(9mo ago)11.1M↑91.7%4MITPHPPHP ^8.2CI passing

Since May 17Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/JBZoo/Codestyle)[ Packagist](https://packagist.org/packages/jbzoo/codestyle)[ RSS](/packages/jbzoo-codestyle/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (19)Versions (84)Used By (4)

JBZoo / Codestyle
=================

[](#jbzoo--codestyle)

[![CI](https://github.com/JBZoo/Codestyle/actions/workflows/main.yml/badge.svg?branch=master)](https://github.com/JBZoo/Codestyle/actions/workflows/main.yml?query=branch%3Amaster)[![Coverage Status](https://camo.githubusercontent.com/4ddaad7993014359036cf7c446ba972872e7ae38f83bde40ed07976be4748f9f/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4a425a6f6f2f436f64657374796c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/JBZoo/Codestyle?branch=master)[![Psalm Coverage](https://camo.githubusercontent.com/4c95636e1057830b3e66eebb8223a6794de4199c8c868c6a2bc54b71e00c1f87/68747470733a2f2f73686570686572642e6465762f6769746875622f4a425a6f6f2f436f64657374796c652f636f7665726167652e737667)](https://shepherd.dev/github/JBZoo/Codestyle)[![Psalm Level](https://camo.githubusercontent.com/f4ee8e2a1644b38f3dfd56334554a5c6f64640b0e508d3aa7e21cd14172f1cea/68747470733a2f2f73686570686572642e6465762f6769746875622f4a425a6f6f2f436f64657374796c652f6c6576656c2e737667)](https://shepherd.dev/github/JBZoo/Codestyle)[![CodeFactor](https://camo.githubusercontent.com/61adebdd2441e3d03f2cab090b6ff28b5befdcb58335740fd6b365f66fbbb196/68747470733a2f2f7777772e636f6465666163746f722e696f2f7265706f7369746f72792f6769746875622f6a627a6f6f2f636f64657374796c652f6261646765)](https://www.codefactor.io/repository/github/jbzoo/codestyle/issues)

[![Stable Version](https://camo.githubusercontent.com/dba3dc5ba4c2e43be03c9e9bd075951e95bfdc23cff278ac55d3cfd2e8411fdb/68747470733a2f2f706f7365722e707567782e6f72672f6a627a6f6f2f636f64657374796c652f76657273696f6e)](https://packagist.org/packages/jbzoo/codestyle/)[![Total Downloads](https://camo.githubusercontent.com/cf504231918518dbfb7c559d239aa03c216c9a7ba3505e8c3f435fb333b503e5/68747470733a2f2f706f7365722e707567782e6f72672f6a627a6f6f2f636f64657374796c652f646f776e6c6f616473)](https://packagist.org/packages/jbzoo/codestyle/stats)[![Dependents](https://camo.githubusercontent.com/f74a58b7e2819d4a24f7b3fb1cfac01da348c1f6b8259413f1283c967f6c3952/68747470733a2f2f706f7365722e707567782e6f72672f6a627a6f6f2f636f64657374796c652f646570656e64656e7473)](https://packagist.org/packages/jbzoo/codestyle/dependents?order_by=downloads)[![GitHub License](https://camo.githubusercontent.com/084bba962536ce81cc18b6be235c14be9dbdc5d726ccda20ecd5b6af95cc37e6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a627a6f6f2f636f64657374796c65)](https://github.com/JBZoo/Codestyle/blob/master/LICENSE)

Comprehensive collection of QA tools and code quality standards for PHP 8.2+ projects. Provides configurations and wrappers for PHPStan, Psalm, PHP-CS-Fixer, PHPUnit, PHPMD, Phan and other popular code analysis tools.

Requirements
------------

[](#requirements)

- **PHP 8.2+** - Modern PHP version with strict typing support
- **Composer** - For dependency management
- **Make** - Build automation tool

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

[](#installation)

```
composer require --dev jbzoo/codestyle
```

Quick Start
-----------

[](#quick-start)

Add the following to your project's `Makefile` to get access to all QA tools:

```
ifneq (, $(wildcard ./vendor/jbzoo/codestyle/src/init.Makefile))
    include ./vendor/jbzoo/codestyle/src/init.Makefile
endif

update: ##@Project Install/Update all 3rd party dependencies
    $(call title,"Install/Update all 3rd party dependencies")
    @echo "Composer flags: $(JBZOO_COMPOSER_UPDATE_FLAGS)"
    @composer update $(JBZOO_COMPOSER_UPDATE_FLAGS)

test-all: ##@Project Run all project tests at once
    @make test
    @make codestyle
```

Available Tools
---------------

[](#available-tools)

This package includes configurations for:

- **PHPStan** - Static analysis tool with strict rules
- **Psalm** - Advanced static analysis with type coverage
- **PHP-CS-Fixer** - Code style fixer with PSR-12 and custom rules
- **PHPCS** - Code sniffer for PSR-12 and PHP compatibility
- **PHPMD** - Mess detector for code quality issues
- **PHPUnit** - Unit testing framework with coverage reporting
- **Phan** - Super strict static analyzer
- **PHPMND** - Magic number detector
- **PHPCPD** - Copy-paste detector

Common Commands
---------------

[](#common-commands)

### Development

[](#development)

```
make update          # Install/update dependencies
make autoload        # Dump optimized autoloader
make clean           # Cleanup build directory
```

### Testing

[](#testing)

```
make test           # Run PHPUnit tests
make test-all       # Run all tests and code style checks
make codestyle      # Run all code style linters
```

### Individual QA Tools

[](#individual-qa-tools)

```
make test-phpstan        # Static analysis with PHPStan
make test-psalm          # Static analysis with Psalm
make test-phpcs          # Code sniffer (PSR-12 + compatibility)
make test-phpcsfixer     # Check PHP-CS-Fixer rules
make test-phpcsfixer-fix # Auto-fix with PHP-CS-Fixer
make test-phpmd          # Mess detector
make test-phan          # Phan static analyzer
```

### Reports

[](#reports)

```
make report-all         # Generate all reports
make report-phpmetrics  # PHP Metrics report
make report-pdepend     # PHP Depend report
```

Complete Command Reference
--------------------------

[](#complete-command-reference)

```
Usage:
  - `make [target]`
  - `make [target] OPTION=value`
  - `ENV_VAR=value make [target]`

Misc:
  help                          Show this text
  list                          Full list of targets

Project:
  autoload                      Dump optimized autoload file for PHP
  build-phar                    Compile phar file
  clean                         Cleanup only build directory
  clean-vendor                  Cleanup all
  test-all                      Run all project tests at once
  update                        Install/Update all 3rd party dependencies

Tests:
  codestyle                     Launch all codestyle linters at once
  test                          Launch PHPUnit Tests (alias "test-phpunit")
  test-composer                 Validates composer.json and composer.lock
  test-composer-reqs            Checks composer.json the defined dependencies against your code
  test-performance              Run benchmarks and performance tests
  test-phan                     Phan - super strict static analyzer for PHP
  test-phpcpd                   PHPcpd - Find obvious Copy&Paste
  test-phpcs                    PHPcs - Checking PHP Code Sniffer (PSR-12 + PHP Compatibility)
  test-phpcsfixer               PhpCsFixer - Check code to follow stylish standards
  test-phpcsfixer-fix           PhpCsFixer - Auto fix code to follow stylish standards
  test-phpmd                    PHPmd - Mess Detector Checker
  test-phpmd-strict             PHPmd - Mess Detector Checker (strict mode)
  test-phpmnd                   PHPmnd - Magic Number Detector
  test-phpstan                  PHPStan - Static Analysis Tool
  test-phpunit                  PHPUnit - Launch General Tests
  test-psalm                    Psalm - static analysis tool for PHP

Reports:
  report-all                    Build all reports at once
  report-composer-diff          What has changed after a composer update
  report-composer-graph         Build composer graph of dependencies
  report-coveralls              Send coverage report to coveralls.io
  report-merge-coverage         Merge all coverage reports in one clover file
  report-pdepend                Build PHP Depend Report
  report-performance            Build performance summary report
  report-phploc                 PHPloc - Show code stats
  report-phpmetrics             Build PHP Metrics Report
  update-extend                 Checks new compatible versions of 3rd party libraries

Trick: Add into your "~/.bash_aliases" the line "complete -W "\`make list\`" make" to use TAB

```

Integration with IDEs
---------------------

[](#integration-with-ides)

The package provides configurations that work seamlessly with:

- **PhpStorm** - Built-in support for all tools
- **VS Code** - Extensions available for all included tools
- **Vim/Neovim** - LSP support through various plugins

Advanced Usage
--------------

[](#advanced-usage)

### Custom PHP-CS-Fixer Rules

[](#custom-php-cs-fixer-rules)

Extend the base configuration in your `.php-cs-fixer.php`:

```
use JBZoo\Codestyle\PhpCsFixer\PhpCsFixerCodingStandard;

return (new PhpCsFixerCodingStandard(__DIR__))
    ->addCustomRules([
        'your_custom_rule' => true,
    ])
    ->getFixerConfig();
```

### PHPUnit Base Classes

[](#phpunit-base-classes)

Use the provided base test classes for consistent testing:

```
use JBZoo\Codestyle\PHPUnit\AbstractPackageTest;

class YourPackageTest extends AbstractPackageTest
{
    protected string $packageName = 'your-package-name';
}
```

Contributing
------------

[](#contributing)

Contributions are welcome! Please ensure:

1. All tests pass: `make test-all`
2. Code follows our standards: `make codestyle`
3. Coverage remains high: `make report-all`

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) file for details.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance58

Moderate activity, may be stable

Popularity36

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity84

Battle-tested with a long release history

 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 ~24 days

Recently: every ~0 days

Total

81

Last Release

279d ago

Major Versions

2.18.2 → 3.0.02021-11-01

2.19.0 → 3.2.02021-12-24

3.4.0 → 4.0.02022-06-04

4.1.0 → 5.0.02023-02-15

5.0.0 → 7.0.02023-07-09

PHP version history (7 changes)1.0.0PHP &gt;=7.1

1.1.0PHP &gt;=7.2

2.1.0PHP ^7.2

4.0.0PHP &gt;=7.4

5.0.0PHP &gt;=8.0

7.0.0PHP ^8.1

7.1.3PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/75e6de2785f6d099699f430ff58404af4fc0e83060d2953028c9664a54704a5f?d=identicon)[smetdenis](/maintainers/smetdenis)

---

Top Contributors

[![SmetDenis](https://avatars.githubusercontent.com/u/1118678?v=4)](https://github.com/SmetDenis "SmetDenis (187 commits)")

---

Tags

codestylejbzoomakefilephpcsphpmdtestingtesting-toolsphpphpcsphpunitPHPStanphpmdtestsqaphp-cs-fixerCoding StandardpsalmCodestylephanjbzoophpmetricsphpcompatibility

### Embed Badge

![Health badge](/badges/jbzoo-codestyle/health.svg)

```
[![Health](https://phpackages.com/badges/jbzoo-codestyle/health.svg)](https://phpackages.com/packages/jbzoo-codestyle)
```

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[friendsoftypo3/content-blocks

TYPO3 CMS Content Blocks - Content Types API | Define reusable components via YAML

103519.9k53](/packages/friendsoftypo3-content-blocks)[jolicode/castor

A lightweight and modern task runner. Automate everything. In PHP.

54743.1k4](/packages/jolicode-castor)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)[aeliot/todo-registrar

Register TODOs from source code in issue tracker

153.0k](/packages/aeliot-todo-registrar)[jbzoo/ci-report-converter

The tool converts different error reporting standards for deep integration with popular CI systems (TeamCity, IntelliJ IDEA, GitHub Actions, etc)

31787.5k2](/packages/jbzoo-ci-report-converter)

PHPackages © 2026

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