Path-sensitive tracing of PHP code for PHPStan extensions
💸 If you like Orisai, please make a donation. Thank you!
Not released yet. The code was extracted from orisai/phpstan-nette on 2026-11-29. Nothing is released, everything may change.
The framework-neutral core for PHPStan extensions which follow what code does across methods and files: a path-sensitive, interprocedural walk over method bodies and file-level scripts, with hooks through which an extension says what matters for its domain, and stores of the traced answers with the files they depend on. It is shared by orisai/phpstan-nette and orisai/phpstan-spaghetti; it knows nothing of a framework.
An extension built on the core requires it; once released:
composer require orisai/phpstan-traceThe extensions built on the core include its extension.neon. Its options, with their defaults:
parameters:
orisai:
trace:
packageType: null # project or library; null reads the type of the root composer.json
testPaths: null # your test code; null reads the root composer.json's autoload-dev paths
traceModelledBodies: false # trace the bodies a model replaces instead of running the models
buildWorkers: null # processes of the build before the analysis; null as many as PHPStan's ownYour code (first-party, traced) is the paths of your configuration.
make update # install the dependencies
make profile PROFILE=php74 # install a dependency profile of tools/profiles into vendor-<name>
make cs # coding standard (make csf fixes)
make lint # parse src and tests on PHP 7.4
make phpstan # static analysis
make tests # tests, make tests PROFILE=<name> with a profile
make tests-profiles # tests with every profile
make gates && make gates-check # run and record every gate on HEAD, see docs/internals/gates.md