PHPackages                             juampi92/phecks - 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. juampi92/phecks

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

juampi92/phecks
===============

A package to run custom PHP checks

v1.4(10mo ago)3404.5k↓39.8%5[1 PRs](https://github.com/juampi92/phecks/pulls)MITPHPPHP ^8.1|^8.2|^8.3|^8.4CI passing

Since Jul 13Pushed 10mo ago2 watchersCompare

[ Source](https://github.com/juampi92/phecks)[ Packagist](https://packagist.org/packages/juampi92/phecks)[ RSS](/packages/juampi92-phecks/feed)WikiDiscussions main Synced 2w ago

READMEChangelog (10)Dependencies (9)Versions (15)Used By (0)

 Phecks
========

[](#------------phecks--------)

 [Documentation](https://juanpablo2.gitbook.io/phecks/) | [Credits](#credits)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/6769599aa29e0a5b5e1730d84a106d602a6344d83e29cc996da1745cb5cc22c1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a75616d706939322f706865636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juampi92/phecks) [![Downloads Per Month](https://camo.githubusercontent.com/197b21f4cb368b50196cfadd40a2f6961c001975bc9f7c156194f0a75fdaad55/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f6a75616d706939322f706865636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juampi92/phecks) [![GitHub Tests Action Status](https://camo.githubusercontent.com/943372f5ec105a5bedb2366a0ff83a64c2058b273126320ba693cbc7848c0709/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6a75616d706939322f706865636b732f72756e2d74657374733f6c6162656c3d7465737473267374796c653d666c61742d737175617265)](https://github.com/juampi92/phecks/actions?query=workflow%3Arun-tests+branch%3Amain) [![PHP from Packagist](https://camo.githubusercontent.com/34eb1c51818f4ed842984b397962e39884b2a04fe520f73f20224cdec2f5d9a9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6a75616d706939322f706865636b732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/juampi92/phecks)

---

Phecks (stands for PHP-Checks) is a custom Check Runner. It will run custom checks in your codebase and will make a report of violations that need fixing.

What is it for?
---------------

[](#what-is-it-for)

- For big teams to align on a styleguide beyond linting.
- Used as an extra set of eyes during the Code Review.
- Teams make their own checks according to their architectural decisions and styleguides.

[See what checks are for](https://juanpablo2.gitbook.io/phecks/about-phecks/what-is-a-check).

On its own, Phecks doesn't contain any checks. You and your team are responsible for defining and implementing these checks based on your architectural decisions.

Phecks will provide you with a structure to develop and run these checks easily.

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

[](#installation)

You can install the package via composer:

```
composer require juampi92/phecks --dev
```

Read the full installation instructions in the [documentation](https://juanpablo2.gitbook.io/phecks/).

Usage
-----

[](#usage)

Create a Check to make sure your team's architectural decisions are respected:

```
/**
 * @implements Check
 */
class ConsoleClassesMustBeSuffixedWithCommandCheck implements Check
{
    public function __construct(
        private readonly ClassSource $source,
    ) {}

    /**
     * This method will get all the possible matches.
     */
    public function getMatches(): MatchCollection
    {
        return $this->source
            ->directory('./app/Console')
            ->run()
            ->reject(fn (ReflectionClass $class): bool => $class->isAbstract())
            ->pipe(new WhereExtendsClassFilter(\Illuminate\Console\Command::class));
    }

    /**
     * processMatch will check if the matches are
     * actual violations, and format them properly.
     */
    public function processMatch($match, FileMatch $file): array
    {
        if (Str::endsWith($match->getName(), 'Command')) {
            return [];
        }

        return [
            ViolationBuilder::make()->message('Command classes must be suffixed with \'Command\''),
        ];
    }
}
```

Add the class in the config `phecks.checks`

And run the following:

```
php artisan phecks:run
```

[![error-output](docs/error-output.png)](docs/error-output.png)

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [juampi92](https://github.com/juampi92)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

50

—

FairBetter than 95% of packages

Maintenance55

Moderate activity, may be stable

Popularity40

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 94.7% 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 ~92 days

Recently: every ~199 days

Total

14

Last Release

300d ago

Major Versions

v0.4 → v1.02022-08-26

PHP version history (4 changes)v0.1PHP ^7.4|^8.0|^8.1

v1.0.1PHP ^8.0|^8.1|^8.2

v1.1PHP ^8.1|^8.2|^8.3

v1.4PHP ^8.1|^8.2|^8.3|^8.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/1f8d31c9bb6d7862e21aac7af0f7b2615dc06485b4c30b19b8d9fdffaa42c712?d=identicon)[juampi92](/maintainers/juampi92)

---

Top Contributors

[![juampi92](https://avatars.githubusercontent.com/u/2080215?v=4)](https://github.com/juampi92 "juampi92 (90 commits)")[![alirezamirsepassi](https://avatars.githubusercontent.com/u/22807073?v=4)](https://github.com/alirezamirsepassi "alirezamirsepassi (2 commits)")[![sunchayn](https://avatars.githubusercontent.com/u/14861869?v=4)](https://github.com/sunchayn "sunchayn (2 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (1 commits)")

---

Tags

ci-cdlaravelphecksphptestingapilaravel

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/juampi92-phecks/health.svg)

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

###  Alternatives

[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M319](/packages/laravel-ai)[illuminate/queue

The Illuminate Queue package.

20433.0M1.8k](/packages/illuminate-queue)[laravel/sail

Docker files for running a basic Laravel application.

1.9k212.4M1.5k](/packages/laravel-sail)[moonshine/moonshine

Laravel administration panel

1.3k268.2k89](/packages/moonshine-moonshine)[laravel/mcp

Rapidly build MCP servers for your Laravel applications.

79227.1M227](/packages/laravel-mcp)[propaganistas/laravel-disposable-email

Disposable email validator

6023.2M7](/packages/propaganistas-laravel-disposable-email)

PHPackages © 2026

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