thecodingmachine/phpstan-strict-rules

A set of additional rules for PHPStan based on best practices followed at TheCodingMachine

Package info

github.com/thecodingmachine/phpstan-strict-rules

Type:phpstan-extension

pkg:composer/thecodingmachine/phpstan-strict-rules

Statistics

Installs: 7 260 258

Dependents: 219

Suggesters: 2

Stars: 290

Open Issues: 12

v1.0.0 2021-11-08 09:10 UTC

Requires

Requires (Dev)

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 2ba8fa8b328c45f3b149c05def5bf96793c594b6

  • David NΓ©grier <d.negrier.woop@thecodingmachine.com>

README

πŸ‘ Latest Stable Version
πŸ‘ Total Downloads
πŸ‘ Latest Unstable Version
πŸ‘ License
πŸ‘ Scrutinizer Code Quality
πŸ‘ Build Status
πŸ‘ Coverage Status

TheCodingMachine's additional rules for PHPStan

This package contains a set of rules to be added to the wonderful PHPStan static analyzer.

Those rules come from TheCodingMachine best practices. They are more "strict" than the default PHPStan rules and some may be controversial. We use those at TheCodingMachine, have found them to help us in our daily work, and ask anyone working with us to follow them.

Rules list

Exception related rules

Superglobal related rules

Condition related rules

Work-in-progress

// Never use public properties
// Never use globals

Installation

We assume that PHPStan is already installed in your project.

To use this extension, require it in Composer:

composer require --dev thecodingmachine/phpstan-strict-rules

If you also install phpstan/extension-installer then you're all set!