pmarki/phpstan-rules

Set of additional PHPStan rules

Installs: 2

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:phpstan-extension

dev-main 2025-04-25 13:36 UTC

This package is auto-updated.

Last update: 2025-05-25 13:47:33 UTC


README

Set of additional PHPStan rules

For legacy codebase

  • check if property and constant shouldn't be set as protected (when is not inherited or class is not abstract)
  • check if property name starts with underscore
  • check if constant name is uppercase

PHPMD rules

  • check for boolean argument flag
  • maximum number of parameters (default 10)

Installation

Run composer require --dev pmarki/phpstan-rules

Edit your phpstan configuration file and add

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

Additional configuration:

parameters:
    pmarki:
        excessiveParameterListRule:
            maxNumberOfParameters: 10