esfahanahan/phpstan-rules

Written by Hossein Hosni.

Requirements

The rules read PHP call sites. They do not boot Laravel and do not depend on illuminate/*.

Install

composer require --dev esfahanahan/phpstan-rules

The dev keyword makes Composer offer to install this package into require-dev.

phpstan/extension-installer loads extension.neon from composer.json:

"extra": {
    "phpstan": {
        "includes": [
            "extension.neon"
        ]
    }
}

Allow the plugin:

{
    "config": {
        "allow-plugins": {
            "phpstan/extension-installer": true
        }
    }
}

Without the installer:

includes:
    - vendor/esfahanahan/phpstan-rules/extension.neon

Use extension.neon as the exported file. It can register rules and later extension types. rules.neon is only a better name when a package contains rules and will never contain anything else.

Credit

Written by Hossein Hosni.

Rules