Skip to content

PHPStan's source code. This is where development happens. Check https://github.com/phpstan/phpstan for the distribution repository.

License

Notifications You must be signed in to change notification settings

phpstan/phpstan-src

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Mar 10, 2025
30b7937 · Mar 10, 2025
Jun 17, 2023
Mar 4, 2025
Feb 2, 2022
Jan 30, 2023
Oct 30, 2024
Oct 9, 2023
Mar 6, 2025
Oct 13, 2024
Nov 27, 2024
Mar 2, 2025
Feb 21, 2025
Feb 21, 2025
Oct 14, 2024
Mar 6, 2025
Mar 10, 2025
Jan 16, 2025
Mar 10, 2025
Oct 13, 2018
Jun 3, 2022
Jun 19, 2020
Jun 19, 2024
Mar 6, 2025
Jan 8, 2022
Jan 28, 2025
Feb 26, 2025
Sep 6, 2024
Nov 11, 2024
Mar 6, 2025
Mar 6, 2025
Dec 5, 2024
Mar 6, 2025
Feb 23, 2023
Apr 10, 2024
Feb 18, 2024
May 3, 2020

Repository files navigation

PHPStan - PHP Static Analysis Tool

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.

Installation

composer install

If you are using macOS and are using an older version of patch, you may have problems with patch application failure during composer install. Try using brew install gpatch to install a newer and supported patch version.

Building

PHPStan's source code is developed on PHP 8.1. For distribution in phpstan/phpstan package and as a PHAR file, the source code is transformed to run on PHP 7.2 and higher.

Initially you need to run composer install 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

make

Running development version

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

make phpstan

Fixing code style

To detect code style issues, run:

make cs

And then to fix code style, run:

make cs-fix

Running tests

Run:

make 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.