airlst / phpstan-config
PHPStan config for AirLST projects
Installs: 6 372
Dependents: 3
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 1
Open Issues: 0
Requires
- php: ^8.3
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: 1.12.7
- phpstan/phpstan-deprecation-rules: 1.2.1
- phpstan/phpstan-strict-rules: 1.6.1
- rector/type-perfect: 1.0.0
- spaze/phpstan-disallowed-calls: 3.5.1
- tomasvotruba/type-coverage: 1.0.0
Requires (Dev)
- airlst/php-cs-fixer-config: ^2.6.0
- airlst/rector-config: ^4.3.10
- ergebnis/composer-normalize: ^2.44.0
- dev-master
- 10.0.1
- 10.0.0
- 9.0.3
- 9.0.2
- 9.0.1
- 9.0.0
- 8.1.1
- 8.1.0
- 8.0.1
- 8.0.0
- 7.0.0
- 6.1.0
- 6.0.0
- 5.0.0
- 4.2.1
- 4.2.0
- 4.1.0
- 4.0.0
- 3.1.0
- 3.0.0
- 2.3.0
- 2.2.1
- 2.2.0
- 2.1.0
- 2.0.2
- 2.0.1
- 2.0.0
- 1.3.7
- 1.3.6
- 1.3.5
- 1.3.4
- 1.3.3
- 1.3.2
- 1.3.1
- 1.3.0
- 1.2.3
- 1.2.2
- 1.2.1
- 1.2.0
- 1.1.1
- 1.1.0
- 1.0.1
- 1.0.0
- dev-disallow-mutable-datetime
- dev-unused-public
- dev-strict-rules
This package is auto-updated.
Last update: 2024-10-28 08:36:27 UTC
README
PHPStan config for AirLST projects.
Installation
You can install the package via Composer:
composer require --dev airlst/phpstan-config
Make sure to allow the phpstan/extension-installer
plugin to run in your composer.json
:
{ "config": { "allow-plugins": { "phpstan/extension-installer": true } } }
Usage
Create a phpstan.php
in the root of your project with the following contents:
<?php declare(strict_types=1); $factory = new Airlst\PhpstanConfig\Factory(['src']); return $factory ->level(8) ->create();
The constructor of the Factory
class takes an array of paths to be scanned for PHP files and analyzed. You can pass any number of paths to it.
Configuration
You can use following configuration options on the Factory
class by chaining them before create()
call:
level(int $level)
: Set the level of PHPStaninclude(string $file)
: Include additional PHPStan neon fileexclude(string $file)
: Exclude provided PHPStan neon filewithBleedingEdge()
: Use bleeding edge version of PHPStanuseCacheDir(string $cacheDir)
: Use cache directory for PHPStantypeCoverage(int $return, int $param, int $property, int $constant)
: Set type coverage percentage, default is 100% for alltypePerfect(bool $nullOverFalse, bool $noMixedProperty, bool $noMixedCaller, bool $narrowParam, bool $narrowReturn)
: Set type perfect configuration, by default all turned on. See rectorphp/type-perfect README for more details.addRule(string $file)
: Add additional rule to PHPStanignoreError(string $message, ?string $path, ?int $count, ?bool $reportUnmatched)
: Ignore provided error messagecheckMissingIterableValueType(bool $enable = true)
: Enables/DisablescheckMissingIterableValueType
rulecheckGenericClassInNonGenericObjectType(bool $enable = true)
: Enables/DisablescheckGenericClassInNonGenericObjectType
rulestrictRules()
: Enables/disables strict rules. For available method arguments you can checkphpstan/phpstan-strict-rules
documentation
Running PHPStan
Run PHPStan with the following command:
./vendor/bin/phpstan analyse -c phpstan.php
Changelog
Please see CHANGELOG for more information what has changed recently.
Contributing
Please see CONTRIBUTING for details.
License
The MIT License (MIT). Please see License File for more information.