PHPackages                             genesos/php-simple-lint - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. genesos/php-simple-lint

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

genesos/php-simple-lint
=======================

v0.1.2(8y ago)01281[1 issues](https://github.com/genesos/php-simple-lint/issues)MITPHPPHP ~7.0

Since Jan 12Pushed 8y agoCompare

[ Source](https://github.com/genesos/php-simple-lint)[ Packagist](https://packagist.org/packages/genesos/php-simple-lint)[ RSS](/packages/genesos-php-simple-lint/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

php-simple-lint
===============

[](#php-simple-lint)

php-simple-lint, extends phpcs easily.

Usage
-----

[](#usage)

php `lint.php` `rule/rule.sample.json` `phpcs`

> php lint.php rule/rule.sample.json vendor/bin/phpcs

Matching process
----------------

[](#matching--process)

```
namespace N;
use U;
class ABC extends A implements B, C
{
  const THE_CONST=1;
  public $property=1;
  public function someMethod($a, $b){
    $var = 2;
  }
}
```

Serialize to

```
['type' => 'use', 'clause' => 'namespace N use U'],
['type' => 'class', 'clause' => 'namespace N class ABC extends A implements B implements C'],
['type' => 'const', 'clause' => 'namespace N class ABC extends A implements B implements C { public THE_CONST'],
['type' => 'property', 'clause' => 'namespace N class ABC extends A implements B implements C { public $property'],
['type' => 'param', 'clause' => 'namespace N class ABC extends A implements B implements C { public function someMethod ( int $a'],
['type' => 'param', 'clause' => 'namespace N class ABC extends A implements B implements C { public function someMethod ( bool $b'],
['type' => 'function', 'clause' => 'namespace N class ABC extends A implements B implements C { public function someMethod ( )'],
['type' => 'var', 'clause' => 'namespace N function someMethod ( ) { $var'],
```

Match with

```
[
  {
    "type": "class",
    "must": "class [\\w]+Model",
    "if": "extends\\s+PlatformBaseModel",
    "reason": "Extends PlatformBaseModel must postfix Model"
  },
  {
    "type": "var",
    "must": "\\$[a-z0-9_]+",
    "reason": "var must lowercase with underbar"
  },
  {
    "type": "param",
    "must": "\\$[a-z0-9_]+",
    "reason": "param must lowercase with underbar"
  },
]
```

Matched result

```
"{$reason}"

```

rule.json
---------

[](#rulejson)

- type (required)
    - `use`, `class`, `const`, `property`, `param`, `function`, `var`
- must (or `must not`) (required)
    - regexes
- if (optional) (string or string\[\])
    - regexes
- if not (optional) (string or string\[\])
    - regexes

Rule case study
---------------

[](#rule-case-study)

```
[
  {
    "type": "use",
    "must": "use .+External.+",
    "if": [
      "namespace Calsule"
    ],
    "if not" : [
      "namespace SafeZoneA",
      "namespace SafeZoneB"
    ]
    "reason": "`Capsuled namspace` must not use `External` namespace"
  },
  {
    "type": "class",
    "must": "class [\\w]+Model",
    "if": "extends\\s+BaseModel",
    "reason": "`Extends BaseModel` must postfix `Model`"
  },
  {
    "type": "var",
    "must": "\\$[a-z0-9_]+",
    "reason": "var must lowercase with underbar"
  },
  {
    "type": "param",
    "must": "\\$[a-z0-9_]+",
    "reason": "param must lowercase with underbar"
  },
  {
    "type": "property",
    "must": "\\$[a-z0-9_]+",
    "reason": "property must lowercase with underbar"
  },
  {
    "type": "const",
    "must": "[A-Z0-9_]+",
    "reason": "const must uppercase"
  },
  {
    "type": "class",
    "must": "class [A-Z][a-zA-Z0-9]+",
    "reason": "class must camel cap"
  },
  {
    "type": "class",
    "must not": "class .+Object",
    "reason": "class must not ends with `Object`"
  },
  {
    "type": "function",
    "must": "function [a-z][a-zA-Z0-9]+",
    "reason": "function must camel"
  }
]

```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Total

3

Last Release

3094d ago

### Community

Maintainers

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

---

Top Contributors

[![genesos](https://avatars.githubusercontent.com/u/6346282?v=4)](https://github.com/genesos "genesos (2 commits)")[![ssaifriend](https://avatars.githubusercontent.com/u/1916350?v=4)](https://github.com/ssaifriend "ssaifriend (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/genesos-php-simple-lint/health.svg)

```
[![Health](https://phpackages.com/badges/genesos-php-simple-lint/health.svg)](https://phpackages.com/packages/genesos-php-simple-lint)
```

###  Alternatives

[deptrac/deptrac

Deptrac is a static code analysis tool that helps to enforce rules for dependencies between software layers.

3.0k9.8M230](/packages/deptrac-deptrac)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k20](/packages/tempest-framework)[brianhenryie/strauss

Prefixes dependencies namespaces so they are unique to your plugin

192484.7k41](/packages/brianhenryie-strauss)[boundwize/structarmed

Configurable PHP architecture guards — define your layers and rules, then keep them enforced

45751.2k23](/packages/boundwize-structarmed)[v.chetkov/php-clean-architecture

PHP Clean Architecture

14661.8k](/packages/vchetkov-php-clean-architecture)

PHPackages © 2026

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