PHPackages                             karriere/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. karriere/code-quality

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

karriere/code-quality
=====================

Code Quality scripts that can be run via Composer.

v5.1.0(6y ago)2012.7k↑425%61Apache-2.0PHPPHP &gt;=7.1

Since May 6Pushed 5y ago11 watchersCompare

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

READMEChangelog (7)Dependencies (9)Versions (27)Used By (1)

[![](https://camo.githubusercontent.com/b3def76d7951161a348c294046488dbdd16ee2729d7f9fca35774af3c1b57fec/687474703a2f2f7777772e6b617272696572652e61742f696d616765732f6c61796f75742f6b61746c6f676f2e737667)](https://www.karriere.at/) [![Build Status](https://camo.githubusercontent.com/9166d06d341b09b3c3b727851fe8d53037cf806424b07444263d9ba43bb8bad6/68747470733a2f2f7472617669732d63692e6f72672f6b6172726965726561742f7068702d636f64652d7175616c6974792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/karriereat/php-code-quality)[![Code Style](https://camo.githubusercontent.com/28e07616fc576917df1c194416ad5a7facadf80a5cd45c53910f7f0615f04dba/68747470733a2f2f7374796c6563692e696f2f7265706f732f37393437303235392f736869656c64)](https://styleci.io/repos/79470259)

❗️ This package is no longer being actively developed. ❗
========================================================

[](#️-this-package-is-no-longer-being-actively-developed-)

Code Quality for PHP packages
=============================

[](#code-quality-for-php-packages)

This package provides code quality scripts that can be run via [Composer](https://github.com/composer/composer).

The scripts also work on continous integration (CI) servers like Jenkins.

Used packages
-------------

[](#used-packages)

### [phpspec/phpspec](https://github.com/phpspec/phpspec)

[](#phpspecphpspec)

Used for testing (SpecBDD) the code.
Must be configured with a `phpspec.yml` file in your root folder.

We are using the `leanphp/phpspec-code-coverage` extension for generating coverage reports.
This extension requires a `phpspec-coverage.yml` file in your root folder and Xdebug enabled.

### [squizlabs/PHP\_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)

[](#squizlabsphp_codesniffer)

Currently used for checking (linting) and fixing the code.
Sniffs all files in `src` directory.

### [phpmd/phpmd](https://github.com/phpmd/phpmd)

[](#phpmdphpmd)

Used for mess detection.
Runs the defined ruleset (`config/phpmd.xml`) on all files in `src` directory.

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

[](#installation)

Run `composer require --dev karriere/code-quality` to install this package.

After installing, insert the desired scripts to your `composer.json`.

```
{
    "scripts": {
        "test": "Karriere\\CodeQuality\\SpecificationTest::run",
        "lint": "Karriere\\CodeQuality\\CodeStyleChecker::run",
        "fix": "Karriere\\CodeQuality\\CodeStyleFixer::run",
        "coverage": "Karriere\\CodeQuality\\CodeCoverage::run",
        "md": "Karriere\\CodeQuality\\MessDetector::run"
    }
}
```

Usage
-----

[](#usage)

You can run a script like this: `composer {script} -- {options}`.

> If you are using Git-Shell on Windows (or Git-Shell in Intellij Terminal on Windows), call scripts like this: `composer.bat {script}`. Otherwise colors will not work.

You can disable `TTY` by adding the `--notty` flag (needed for Jenkins).
On Windows platform it's disabled automatically.

```
composer {script} -- --env=jenkins --notty

```

### Scripts

[](#scripts)

#### `test`

[](#test)

```
Usage:
  test [--] [options]

Options:
      --fail     Exit with 1 if tests fail.
      --notty    Disable TTY.
      --ptimeout Set process timeout (defaults to 60 seconds).
   -v --verbose  Increase the verbosity of messages.

```

#### `coverage`

[](#coverage)

```
Usage:
  coverage [--] [options]

Options:
      --env       Specifiy the environment. Possible values:
                  'local': prints output on command-line.
                  'jenkins': generates a JUnit report file.
      --notty     Disable TTY.
      --ptimeout  Set process timeout (defaults to 60 seconds).

```

#### `lint`

[](#lint)

```
Usage:
  lint [--] [options]

Options:
      --env       Specifiy the environment. Possible values:
                  'local': prints output on command-line.
                  'jenkins': generates a checkstyle report file.
      --fail      Exit with 1 if linting fails.
      --notty     Disable TTY.
      --ptimeout  Set process timeout (defaults to 60 seconds).

```

#### `md`

[](#md)

```
Usage:
  lint [--] [options]

Options:
      --env       Specifiy the environment. Possible values:
                  'local': prints output on command-line.
                  'jenkins': generates a xml report file.
      --notty     Disable TTY.
      --ptimeout  Set process timeout (defaults to 60 seconds).

```

#### `fix`

[](#fix)

```
Usage:
  fix [--] [options]

Options:
      --notty     Disable TTY.
      --ptimeout  Set process timeout (defaults to 60 seconds).

```

Using custom matchers
---------------------

[](#using-custom-matchers)

This package integrates [karriere/phpspec-matchers](https://github.com/karriereat/phpspec-matchers). In order to use the custom matchers defined in this package, please include the extension configuration in your `phpspec.yml`.

FAQ
---

[](#faq)

### Why do I have to provide two phpspec configuration files?

[](#why-do-i-have-to-provide-two-phpspec-configuration-files)

The code-coverage-extension slows down the phpspec tests, so we excluded it from the normal configuration file. Keep tests fast!

### How do I increase the verbosity of the `test`-script output?

[](#how-do-i-increase-the-verbosity-of-the-test-script-output)

Run `composer test -- -v`.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~66 days

Recently: every ~199 days

Total

22

Last Release

2278d ago

Major Versions

v1.3.0 → v2.0.0-alpha.12016-09-05

v1.3.1 → v2.0.02017-02-09

v2.0.0 → v3.0.02017-04-11

v3.0.0 → v4.0.02017-12-15

v4.2.0 → v5.0.02019-11-20

PHP version history (3 changes)v2.0.0-alpha.1PHP &gt;=5.6.4

v3.0.0PHP &gt;=7.0

v4.1.0PHP &gt;=7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/5d7eebb96db1721780c3e38450c4408c15b3fde74daaefdd1412508224d4b7b5?d=identicon)[jaylinski](/maintainers/jaylinski)

![](https://www.gravatar.com/avatar/59ac000ca995a016e613c45c25d9b9c319853c5a783299aa5cc059f2c4477aab?d=identicon)[karriere-at-dev](/maintainers/karriere-at-dev)

---

Top Contributors

[![jaylinski](https://avatars.githubusercontent.com/u/1668766?v=4)](https://github.com/jaylinski "jaylinski (9 commits)")[![fetzi](https://avatars.githubusercontent.com/u/3509426?v=4)](https://github.com/fetzi "fetzi (4 commits)")[![Witti](https://avatars.githubusercontent.com/u/80333?v=4)](https://github.com/Witti "Witti (3 commits)")[![k9ordon](https://avatars.githubusercontent.com/u/102591?v=4)](https://github.com/k9ordon "k9ordon (1 commits)")[![Munsio](https://avatars.githubusercontent.com/u/646513?v=4)](https://github.com/Munsio "Munsio (1 commits)")

---

Tags

code-qualitycode-stylephpspectestingcode qualityscripts

### Embed Badge

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

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

###  Alternatives

[brianium/paratest

Parallel testing for PHP

2.5k118.8M754](/packages/brianium-paratest)[infection/infection

Infection is a Mutation Testing framework for PHP. The mutation adequacy score can be used to measure the effectiveness of a test set in terms of its ability to detect faults.

2.2k26.2M1.8k](/packages/infection-infection)[phpbench/phpbench

PHP Benchmarking Framework

2.0k13.0M627](/packages/phpbench-phpbench)[captainhook/captainhook

PHP git hook manager

1.1k6.8M370](/packages/captainhook-captainhook)[liuggio/fastest

Simple parallel testing execution... with some goodies for functional tests.

4825.6M26](/packages/liuggio-fastest)[magento/magento2-functional-testing-framework

Magento2 Functional Testing Framework

15511.5M30](/packages/magento-magento2-functional-testing-framework)

PHPackages © 2026

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