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

ActivePhpstan-extension[Testing &amp; Quality](/categories/testing)

hiperdk/phpstan-rules
=====================

PHPStan rules by Hiper

1.0.0(1y ago)7304.7k↓13.9%[1 PRs](https://github.com/hiperdk/phpstan-rules/pulls)1GPL-3.0-or-laterPHPPHP &gt;=8.3CI passing

Since Apr 1Pushed 1y agoCompare

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

READMEChangelog (1)Dependencies (3)Versions (3)Used By (1)

hiperdk/phpstan-rules
=====================

[](#hiperdkphpstan-rules)

[![CI](https://github.com/hiperdk/phpstan-rules/actions/workflows/ci.yml/badge.svg)](https://github.com/hiperdk/phpstan-rules/actions/workflows/ci.yml)[![Release](https://github.com/hiperdk/phpstan-rules/actions/workflows/release.yml/badge.svg)](https://github.com/hiperdk/phpstan-rules/actions/workflows/release.yml)[![Release](https://camo.githubusercontent.com/70636b50426d292360ff49e147aba6512568915a0bc8a158bf21138698fc8f51/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f6869706572646b2f7068707374616e2d72756c65732e737667)](https://github.com/hiperdk/phpstan-rules/releases/latest)[![Packagist Version](https://camo.githubusercontent.com/4d552d1a7eb625eb3cd438be8353397b9e4ba8d32e59b495746df23f7be59c66/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6869706572646b2f7068707374616e2d72756c6573)](https://packagist.org/packages/hiperdk/phpstan-rules)[![License](https://camo.githubusercontent.com/c2790cb90554905e7f41e38ca62f6c596c4156cde4918f666d8e533ff4d6532a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6869706572646b2f7068707374616e2d72756c6573)](LICENSE)

Rules list
----------

[](#rules-list)

### You should not have a untyped const

[](#you-should-not-have-a-untyped-const)

❌

```
public const x = 'y';
```

✅

```
public const string x = 'y';
```

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

[](#installation)

We assume that [PHPStan](https://phpstan.org/) is already installed in your project.

To use this extension, require it in [Composer](https://getcomposer.org/):

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

If you also install [phpstan/extension-installer](https://github.com/phpstan/extension-installer) then you're all set!

 Manual installationIf you don't want to use `phpstan/extension-installer`, include phpstan-strict-rules.neon in your project's PHPStan config:

```
includes:
    - vendor/hiperdk/phpstan-rules/extension.neon
```

Development setup
-----------------

[](#development-setup)

### Requirements

[](#requirements)

- Docker
- Docker compose
- Make

### Getting started

[](#getting-started)

```
# Clone the repository
$ git clone git@github.com:hiperdk/phpstan-rules.git
$ cd phpstan-rules
$ make
# You now have a shell with PHP and can run the following commands:
$ composer phpunit
$ composer phpstan

```

Releasing new version
---------------------

[](#releasing-new-version)

```
# Replace 1.0.0 with the version you want to release
$ git tag -m "1.0.0" 1.0.0
$ git push origin 1.0.0
# GitHub Actions will automatically create a new release on GitHub and Packagist
```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance47

Moderate activity, may be stable

Popularity41

Moderate usage in the ecosystem

Community14

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 58.8% 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

412d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/030c26f4598bb50f966fad7b7a48abe09b393ff5dbd6daf08d28b758cd9a1626?d=identicon)[frederikhs](/maintainers/frederikhs)

![](https://www.gravatar.com/avatar/c6fb349983c0b3126e50d883ffd1a0933610e318a4a89f9c8592fb7116864bcd?d=identicon)[hiper-man](/maintainers/hiper-man)

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

---

Top Contributors

[![frederikhs](https://avatars.githubusercontent.com/u/30222725?v=4)](https://github.com/frederikhs "frederikhs (10 commits)")[![jlonborg](https://avatars.githubusercontent.com/u/36929470?v=4)](https://github.com/jlonborg "jlonborg (7 commits)")

---

Tags

phpstanphpstan-extensionstatic-analysisstatic analysis

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k43.5M5.2k](/packages/larastan-larastan)[phpstan/phpstan-symfony

Symfony Framework extensions and rules for PHPStan

78768.9M1.5k](/packages/phpstan-phpstan-symfony)[phpstan/phpstan-doctrine

Doctrine extensions for PHPStan

66766.6M1.1k](/packages/phpstan-phpstan-doctrine)[phpstan/phpstan-strict-rules

Extra strict and opinionated rules for PHPStan

69661.6M3.9k](/packages/phpstan-phpstan-strict-rules)[phpstan/phpstan-phpunit

PHPUnit extensions and rules for PHPStan

529102.1M8.6k](/packages/phpstan-phpstan-phpunit)[spaze/phpstan-disallowed-calls

PHPStan rules to detect disallowed method &amp; function calls, constant, namespace, attribute, property &amp; superglobal usages, with powerful rules to re-allow a call or a usage in places where it should be allowed.

33320.0M375](/packages/spaze-phpstan-disallowed-calls)

PHPackages © 2026

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