• Stars
    star
    295
  • Rank 135,501 (Top 3 %)
  • Language
    PHP
  • License
    MIT License
  • Created over 4 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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

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 encounter dependency problem, try using export COMPOSER_ROOT_VERSION=1.10.x-dev

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.

More Repositories

1

phpstan

PHP Static Analysis Tool - discover bugs in your code without running it!
PHP
12,445
star
2

phpdoc-parser

Next-gen phpDoc parser with support for intersection types and generics
PHP
1,212
star
3

phpstan-symfony

Symfony extension for PHPStan
PHP
655
star
4

phpstan-doctrine

Doctrine extensions for PHPStan
PHP
547
star
5

phpstan-strict-rules

Extra strict and opinionated rules for PHPStan
PHP
545
star
6

phpstan-phpunit

PHPUnit extensions and rules for PHPStan
PHP
427
star
7

extension-installer

Composer plugin for automatic installation of PHPStan extensions.
PHP
361
star
8

phpstan-deprecation-rules

PHPStan rules for detecting usage of deprecated classes, methods, properties, constants and traits.
PHP
341
star
9

phpstan-webmozart-assert

PHPStan extension for webmozart/assert
PHP
150
star
10

phpstan-nette

Nette Framework class reflection extension for PHPStan & framework-specific rules
PHP
98
star
11

phpstan-shim

[DEPRECATED] This repository provides easy way to install PHPStan without the risk of conflicting dependencies.
PHP
87
star
12

phpstan-mockery

PHPStan extension for Mockery
PHP
76
star
13

phpstan-beberlei-assert

PHPStan extension for beberlei/assert
PHP
35
star
14

vim-phpstan

A Vim plugin for PHPStan - https://github.com/phpstan/phpstan. It calls `phpstan` to do static analysis of your PHP code and displays the errors in Vim's quickfix list.
PHP
28
star
15

php-8-stubs

PHP
25
star
16

phpstan-php-parser

PHP-Parser extension for PHPStan
Makefile
23
star
17

phpstan-dibi

Dibi class reflection extension for PHPStan
PHP
13
star
18

build-cs

Coding standard for 1st party PHPStan extensions
2
star