The Wayback Machine - https://web.archive.org/web/20200612051948/https://github.com/phpstan/phpstan-src
Skip to content
PHPStan's source code. This is where development happens. Check https://github.com/phpstan/phpstan for the distribution repository.
PHP
Branch: master
Clone or download

Latest commit

Latest commit 57a6585 Jun 11, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Bump actions/checkout from v2.0.0 to v2.2.0 Jun 10, 2020
bin Fix composer.json Jun 2, 2020
build-cs Update dealerdirect/phpcodesniffer-composer-installer requirement May 28, 2020
build Introduce bootstrapFiles config option; deprecate bootstrap config op… Jun 7, 2020
compiler Fix build May 26, 2020
conf Introduce scanDirectories Jun 7, 2020
src PhpParameterReflection - safe guards against nonexistent classes Jun 11, 2020
stubs Return missing rules to StubValidator Jun 10, 2020
tests Fix Jun 11, 2020
tmp Build requires cache directory to exist Oct 13, 2018
.editorconfig Fix glob patterns in .editorconfig Sep 24, 2017
.gitattributes github: Highlight neonfiles with yaml syntax highlighter Apr 17, 2020
.gitignore PHAR compiler inside phpstan/phpstan-src Nov 4, 2019
.travis.yml Fix Jun 3, 2020
CODE_OF_CONDUCT.md Code of Conduct Jul 17, 2016
LICENSE License copyright - use only starting year, the current year is not n… Jan 4, 2018
README.md README - note about the result cache Jun 10, 2020
build.xml Check default property value against native type Jun 3, 2020
codecov.yml Turn off Codecov comments Mar 6, 2020
composer.json Fix traits issues Jun 11, 2020
phpcs.xml Result cache - use lazy callback for errors array in case older PHPSt… Mar 16, 2020
phpstan-baseline.neon Fix build May 24, 2020
preload.php Fix issue with different PHP-Parser version in the project May 3, 2020

README.md

PHPStan - PHP Static Analysis Tool

Build Status Build PHPStan Enabled


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

vendor/bin/phing

Running development version

You can also choose to run only part of the build. To analyse PHPStan by PHPStan itself, run:

vendor/bin/phing phpstan

Fixing code style

To detect code style issues, run:

vendor/bin/phing cs

This requires PHP 7.4. On older versions the build target will be skipped and succeed silently.

And then to fix code style, run:

vendor/bin/phing cs-fix

Running tests

Run:

vendor/bin/phing tests

Debugging

  1. Make sure XDebug is installed and configured.
  2. Add --xdebug option when running PHPStan. Without it PHPStan turns the debugger off at runtime.
  3. If you're not debugging the result cache, also add the --debug option.

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.

You can’t perform that action at this time.