.phan/README.md
make phan # Run static analysis
PsySH supports wide dependency version ranges (php-parser 4.0-5.x, symfony 3.4-7.x), which creates version-specific issues. We use separate baseline files to handle these:
baseline-min-versions.phpFalse positives from minimum versions (php-parser 4.0, symfony 3.4).
Issues occur because Phan doesn't see newer APIs that were added in later versions:
Node\Name::getParts() method (use ->parts property in 4.0)Node\VariadicPlaceholder class (added in 4.3+)Node\Scalar\Int_, Float_ (were LNumber/DNumber in 4.0)Node\UnionType (added in 4.9+)Remove when: Dropping php-parser 4.x or symfony 3.x/4.x support.
baseline-new-deprecations.phpFuture deprecations from latest versions (php-parser 5.x).
For example:
UseUse → UseItemLNumber → Int_->parts property → getParts() methodasText(), etc.)Remove when: Dropping php-parser 4.x or symfony console 3.x support.
baseline-internal-deprecations.phpInternal PsySH deprecations maintained for backward compatibility:
Configuration::getManualDb() → Use getManual()Configuration::applyFormatterStyles() → Use ThemesConfiguration->formatterStyles property → Use Theme configurationRemove when: Releasing next 0.x release.
baseline-external-deps.phpExternal dependency code issues related to external dependencies and optional extensions.
baseline.phpMerges all the above baselines (default baseline used by Phan).
baseline-current-issues.phpAuto-generated baseline of current issues (not loaded by default). Used by CI to enforce "no new issues" while allowing local make phan to show all issues.
Regenerate with:
vendor/bin/phan --allow-polyfill-parser --save-baseline=.phan/baseline-current-issues.php