PHPackages                             devwolk/linters - 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. devwolk/linters

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

devwolk/linters
===============

Centralized PHP linter configurations and static analysis tools for PHP projects

v0.1.3(1mo ago)081MITPHPPHP &gt;=8.3CI passing

Since Feb 6Pushed 1mo agoCompare

[ Source](https://github.com/DevWolk/linters)[ Packagist](https://packagist.org/packages/devwolk/linters)[ RSS](/packages/devwolk-linters/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (4)Dependencies (36)Versions (6)Used By (0)

Linters Library
===============

[](#linters-library)

Centralized PHP linter configurations. Rules are bundled - you configure only paths.

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

[](#installation)

```
composer require --dev devwolk/linters
```

**Requirements:** PHP 8.4+

Supported Tools
---------------

[](#supported-tools)

ToolDescription[Rector](https://getrector.com/documentation)Auto-refactoring, PHP migrations[PHP-CS-Fixer](https://cs.symfony.com/doc/usage.html)Code formatting (PSR-12)[PHPStan](https://phpstan.org/user-guide/getting-started)Static analysis (level 8)[PHPCS](https://github.com/PHPCSStandards/PHP_CodeSniffer)Code style (PSR-12 + Slevomat)[PHPCBF](https://github.com/PHPCSStandards/PHP_CodeSniffer)Auto-fix PHPCS violations[PHPMD](https://phpmd.org/documentation/index.html)Code quality detector[composer-unused](https://github.com/composer-unused/composer-unused)Unused dependencies[composer-normalize](https://github.com/ergebnis/composer-normalize)Normalize composer.jsonConfiguration
-------------

[](#configuration)

An example of the full `composer.json` configuration:

```
{
  "extra": {
    "linters": {
      "rector": {
        "paths": ["app", "database", "tests", "routes"],
        "php-version": "8.4",
        "skip-dirs": ["app/Http/Requests"],
        "skip-files": ["app/Providers/AutoWireServiceProvider.php"],
        "sets": [
          "laravel12",
          "phpunit12",
          "doctrine"
        ],
        "parallel": {
          "enabled": true,
          "files-per-process": 40,
          "timeout": 360,
          "max-processes": 2
        },
        "import-names": {
          "import-names": true,
          "import-doc-block-names": false,
          "import-short-classes": false,
          "remove-unused-imports": true
        },
        "cache-dir": ".cache/rector",
        "memory-limit": "2048M"
      },
      "php-cs-fixer": {
        "paths": ["app", "config", "database", "routes"],
        "skip-dirs": ["bootstrap", "config", "docker", "public", "resources", "routes", "storage", "vendor"],
        "skip-files": [],
        "parallel": true,
        "cache-dir": ".cache/php-cs-fixer"
      },
      "phpcs": {
        "paths": ["app", "config", "database", "routes"],
        "skip-dirs": ["vendor"],
        "skip-files": ["tests/TestCase.php", "*\\.blade\\.php$"],
        "parallel": 4,
        "cache-dir": ".cache/phpcs",
        "rule-excludes": {
          "Generic.Metrics.CyclomaticComplexity.TooHigh": ["tests/*", "src/Utils/ConfigurationLoader.php"],
          "Squiz.WhiteSpace.ScopeClosingBrace": ["tests/*", "src/Utils/ConfigurationLoader.php"]
        }
      }
    }
  }
}
```

### Options

[](#options)

OptionTypeToolsDescription`paths``string[]`all\***Required.** Directories to analyze`php-version``string`rectorTarget PHP version: `8.3`, `8.4`, `8.5` (default: `8.4`)`skip-dirs``string[]`all\*Directories to exclude`skip-files``string[]`all\*File patterns to exclude`parallel``bool|int|object`rector, php-cs-fixer, phpstan, phpcsParallel execution`cache-dir``string`rector, php-cs-fixer, phpstan, phpcsCache directory`baseline``string`phpstan, phpmdBaseline file`sets``string[]`rectorRector sets: `laravel11`, `laravel12`, `symfony`, `doctrine``memory-limit``string`rectorMemory limit (e.g., `2048M`, `4G`)`import-names``object`rectorImport names configuration (see below)`rule-excludes``object`phpcsRule-specific exclude patterns (see below)`named-filters``string[]`composer-unusedPackages to ignore\*except composer-unused and composer-normalize

### Rector Import Names

[](#rector-import-names)

The `import-names` option controls how Rector handles `use` import statements:

```
{
  "extra": {
    "linters": {
      "rector": {
        "paths": ["src"],
        "import-names": {
          "import-names": true,
          "import-doc-block-names": false,
          "import-short-classes": false,
          "remove-unused-imports": true
        }
      }
    }
  }
}
```

KeyTypeDefaultDescription`import-names``bool``true`Add `use` imports for fully qualified class names`import-doc-block-names``bool``false`Add `use` imports for docblock type hints`import-short-classes``bool``false`Import short class names (e.g., `DateTime`)`remove-unused-imports``bool``true`Remove unused `use` importsAll fields are optional. Omitted fields use their default values. If `import-names` is not specified at all, all defaults apply.

### PHPCS Rule Excludes

[](#phpcs-rule-excludes)

The `rule-excludes` option allows you to exclude specific PHPCS rules for certain files or directories:

```
{
  "extra": {
    "linters": {
      "phpcs": {
        "paths": ["src", "tests"],
        "rule-excludes": {
          "Generic.Metrics.CyclomaticComplexity.TooHigh": ["tests/*", "src/Utils/ConfigurationLoader.php"],
          "Squiz.WhiteSpace.ScopeClosingBrace": ["tests/*", "src/Utils/ConfigurationLoader.php"]
        }
      }
    }
  }
}
```

This generates XML rules like:

```

    tests/*
    src/Utils/ConfigurationLoader.php

```

To exclude a rule entirely, use `*` as the pattern:

```
{
  "rule-excludes": {
    "Squiz.WhiteSpace.ScopeClosingBrace": ["*"]
  }
}
```

Usage
-----

[](#usage)

```
./vendor/bin/linters run rector
./vendor/bin/linters run php-cs-fixer
./vendor/bin/linters run phpstan
./vendor/bin/linters run phpcs
./vendor/bin/linters run phpcbf
./vendor/bin/linters run phpmd
./vendor/bin/linters run composer-unused
./vendor/bin/linters run composer-normalize
```

Extra arguments can be passed after `--`:

```
./vendor/bin/linters run rector -- --dry-run
./vendor/bin/linters run php-cs-fixer -- --dry-run --diff
./vendor/bin/linters run phpstan -- --generate-baseline
```

Architecture
------------

[](#architecture)

```
src/
├── Console/Command/     CLI commands (run, generate)
├── Service/             ToolRunner orchestration
├── CommandBuilder/      Command builders (one per tool)
├── ConfigGenerator/     Config file generators
├── DTO/                 Configuration DTOs
├── Enum/                Tool registry
└── Utils/               ConfigurationLoader, validation

```

Each tool has:

- **ConfigGenerator** — generates config files (phpstan.neon, phpcs.xml, etc.)
- **CommandBuilder** — builds CLI command with proper arguments

Rector for Laravel
------------------

[](#rector-for-laravel)

Requires: `composer require --dev driftingly/rector-laravel`

Baseline
--------

[](#baseline)

For legacy projects with many existing issues, generate a baseline to ignore them:

**PHPStan:**

```
./vendor/bin/linters run phpstan -- --generate-baseline
```

Then add to config: `"baseline": "phpstan-baseline.neon"`

**PHPMD:**

```
./vendor/bin/linters run phpmd -- --generate-baseline
```

Then add to config: `"baseline": "phpmd.baseline.xml"`

Examples
--------

[](#examples)

See `examples/` for Laravel and Symfony configurations.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance89

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.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 ~11 days

Total

5

Last Release

57d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc3edabb24364e95c32ecb6a142c17a43a3e4e22cba8d4ab25bbf7825863fcb1?d=identicon)[DevWolk](/maintainers/DevWolk)

---

Top Contributors

[![vovk-ai-dev](https://avatars.githubusercontent.com/u/248867768?v=4)](https://github.com/vovk-ai-dev "vovk-ai-dev (43 commits)")[![DevWolk](https://avatars.githubusercontent.com/u/39851108?v=4)](https://github.com/DevWolk "DevWolk (1 commits)")

---

Tags

phpcsPHPStanstatic analysisphpmdcode qualitylinterrectorphp-cs-fixercomposer-normalizecomposer-unused

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/devwolk-linters/health.svg)

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

###  Alternatives

[vimeo/psalm

A static analysis tool for finding errors in PHP applications

5.8k77.5M6.7k](/packages/vimeo-psalm)[ekino/phpstan-banned-code

Detected banned code using PHPStan

2925.6M92](/packages/ekino-phpstan-banned-code)[sci3ma/symfony-grumphp

Configured GrumPHP with bunch of tools for static code analysis Symfony Framework

196.7k](/packages/sci3ma-symfony-grumphp)[jbzoo/ci-report-converter

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

30784.4k2](/packages/jbzoo-ci-report-converter)[acquia/coding-standards

PHP\_CodeSniffer rules (sniffs) for Acquia coding standards

214.8M28](/packages/acquia-coding-standards)

PHPackages © 2026

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