hiperdk / phpstan-rules
PHPStan rules by Hiper
Installs: 66 809
Dependents: 1
Suggesters: 0
Security: 0
Stars: 5
Watchers: 0
Forks: 0
Open Issues: 1
Type:phpstan-extension
Requires
- php: >=8.3
- phpstan/phpstan: ^1.12|^2.0
Requires (Dev)
- nikic/php-parser: ^5
- phpunit/phpunit: ^12
This package is auto-updated.
Last update: 2025-05-29 10:03:08 UTC
README
Rules list
You should not have a untyped const
❌
public const x = 'y';
✅
public const string x = 'y';
Installation
We assume that PHPStan is already installed in your project.
To use this extension, require it in Composer:
composer require --dev hiperdk/phpstan-rules
If you also install phpstan/extension-installer then you're all set!
Manual installation
If 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
Requirements
- Docker
- Docker compose
- Make
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
# 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