PHPStan - PHP Static Analysis Tool
This repository (phpstan/phpstan-src) is for PHPStan's development only. Head to phpstan/phpstan for the main README, or to create an issue.
Contributing
Any contributions are welcome.
Building
PHPStan's source code is developed on PHP 7.4. For distribution in phpstan/phpstan package and as a PHAR file, the source code is transformed to run on PHP 7.1 and higher.
Initially you need to run composer install, or composer update in case you aren't working in a directory which was built before.
Afterwards you can either run the whole build including linting and coding standards using
makeRunning development version
You can also choose to run only part of the build. To analyse PHPStan by PHPStan itself, run:
make phpstanFixing code style
To detect code style issues, run:
make csThis requires PHP 7.4. On older versions the build target will be skipped and succeed silently.
And then to fix code style, run:
make cs-fixRunning tests
Run:
make testsDebugging
- Make sure XDebug is installed and configured.
- Add
--xdebugoption when running PHPStan. Without it PHPStan turns the debugger off at runtime. - If you're not debugging the result cache, also add the
--debugoption.
Code of Conduct
This project adheres to a Contributor Code of Conduct. By participating in this project and its community, you are expected to uphold this code.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
