PHPackages                             skukunin/phpstan-rules - 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. skukunin/phpstan-rules

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

skukunin/phpstan-rules
======================

Custom PHPStan rules for static analysis

v1.0.0(11mo ago)034MITPHPCI passing

Since Jun 1Pushed 11mo agoCompare

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

READMEChangelog (1)Dependencies (5)Versions (2)Used By (0)

PHPStan Rules Library
=====================

[](#phpstan-rules-library)

This library provides a collection of custom PHPStan rules to help you enforce best practices in your PHP projects. It includes rules that will catch common anti-patterns and misuses, such as using deprecated methods, misusing container methods, and error silencing practices.

How to Use
----------

[](#how-to-use)

1. **Installation**: Install this library via Composer:

```
composer require skukunin/phpstan-rules --dev
```

2. **Configuration**: Register the custom rules in your PHPStan configuration file (e.g., `phpstan.neon` or `extension.neon`).

You can add all the rules in your PHPStan configuration file:

```
includes:
    - phpstan-baseline.neon
    - vendor/skukunin/phpstan-rules/extension.neon
parameters:
    level: 6
...
```

or add only needed rules:

```
rules:
    - SKukunin\PHPStanRules\Rules\NoControllerGetParameterRule
```

3. **Running PHPStan**: Run PHPStan on your project to report any detected issues:

```
vendor/bin/phpstan analyse src tests
```

Use Cases
---------

[](#use-cases)

- **Symfony Projects**: This library is designed with Symfony projects in mind. It provides rules to enforce best practices such as avoiding the use of `getParameter` in controllers, encouraging better dependency injection practices.
- **Legacy Codebases**: Gradually refactor and improve legacy code by integrating these rules to catch common pitfalls.
- **CI/CD Integration**: Ensure code quality across your projects by integrating these custom PHPStan rules into your automated build pipelines.

Existing Rules
--------------

[](#existing-rules)

- `NoContainerGetRule`: Prevents misuse of container get methods.
- `NoControllerGetParameterRule`: Flags the usage of `getParameter` within controllers.
- `NoErrorSilencingRule`: Disallows use of PHP's error suppression operator (@).

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

[](#contributing)

Contributions are welcome! If you encounter issues or have ideas for enhancements, please open an issue or submit a pull request on GitHub.

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance50

Moderate activity, may be stable

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity36

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

351d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e39b711e4663a4bed835ec5960cd263885214148b8e7de37342c5231346ccaf?d=identicon)[skukunin](/maintainers/skukunin)

---

Top Contributors

[![skukunin](https://avatars.githubusercontent.com/u/115872400?v=4)](https://github.com/skukunin "skukunin (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/skukunin-phpstan-rules/health.svg)

```
[![Health](https://phpackages.com/badges/skukunin-phpstan-rules/health.svg)](https://phpackages.com/packages/skukunin-phpstan-rules)
```

###  Alternatives

[phpspec/prophecy

Highly opinionated mocking framework for PHP 5.3+

8.5k551.7M682](/packages/phpspec-prophecy)[brianium/paratest

Parallel testing for PHP

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

Thin assertion library for input validation in business models.

2.4k96.9M570](/packages/beberlei-assert)[mikey179/vfsstream

Virtual file system to mock the real file system in unit tests.

1.4k108.0M2.7k](/packages/mikey179-vfsstream)[orchestra/testbench

Laravel Testing Helper for Packages Development

2.2k39.1M32.1k](/packages/orchestra-testbench)[phpspec/phpspec

Specification-oriented BDD framework for PHP 7.1+

1.9k36.7M3.1k](/packages/phpspec-phpspec)

PHPackages © 2026

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