A static analysis tool for finding errors in PHP applications
Permalink
Failed to load latest commit information.
assets/config_levels Add support for checking DeprecatedTrait and DeprecatedConstant Aug 10, 2018
bin Multi-stage builds (#928) Aug 2, 2018
docs Add specific ForbiddenEcho issue if a config flag is set Sep 18, 2018
examples Treat required files the same as the files that require them, reporti… May 30, 2018
src Allow InvalidCatch and InvalidThrow to be suppressed per-class Sep 21, 2018
tests Allow InvalidCatch and InvalidThrow to be suppressed per-class Sep 21, 2018
vendor-bin/box Simplify the PHAR build script May 15, 2018
.editorconfig adding editorconfig that seems to match the php files (#163) Jun 26, 2017
.gitignore Ignore .ds_store May 19, 2018
.php_cs.dist Fix formatting in examples Jan 18, 2018
.scrutinizer.yml Attempt to fix builds on scrutinizer-ci (#788) Jun 1, 2018
.travis.yml Add secure github token Aug 7, 2018
CHANGELOG.md Solidify changes to V2 May 11, 2018
CODE_OF_CONDUCT.md Add code of conduct Dec 31, 2017
CONTRIBUTING.md Add reference to how Psalm works overview Jan 14, 2018
LICENSE Add license Nov 21, 2016
NEWS.md Prepare v2 dev release Apr 19, 2018
PsalmLogo.png New and improved logo Jan 16, 2017
README.md README Typo: missing word (#956) Aug 25, 2018
box.json.dist Fix #748 - correct paths that stopped working May 30, 2018
composer.json Bump XDebugHandler version Jul 17, 2018
config.xsd Allow InvalidCatch and InvalidThrow to be suppressed per-class Sep 21, 2018
phpcs.xml Resolve as many names as possible in the parsing stage Jul 13, 2018
phpunit.xml.dist Allow tests to not test anything Jan 22, 2018
psalm Move Psalm execution code into PHP file that Psalm can analyse Dec 29, 2017
psalm.xml.dist Analyse SimpleNameResolver too Jul 22, 2018
psalter Break file manipulation out into Psalter Jan 7, 2018
scoper.inc.php Fix #748 - correct paths that stopped working May 30, 2018

README.md

logo

Packagist Packagist Travis CI Coverage Status

Psalm is a static analysis tool for finding errors in PHP applications, built on top of PHP Parser.

It's able to find a large number of issues, but it can also be configured to only care about a small subset of those.

Try a live demo, or install it in your project by following the Quickstart Guide below.

Psalm documentation

Documentation is available on Psalm’s website, generated from the docs folder.

Quickstart Guide

Install via Composer:

composer require --dev vimeo/psalm

Add a config:

./vendor/bin/psalm --init

Then run Psalm:

./vendor/bin/psalm

The config created above will show you all issues in your code, but will emit INFO issues (as opposed to ERROR) for certain common trivial code problems. If you want a more lenient config you can specify the level with

./vendor/bin/psalm --init [source_dir] [level]

You can also learn how to suppress certain issues.

How Psalm Works

A basic rundown of Psalm’s internals can be found in docs/how_psalm_works.md.

Acknowledgements

The engineering team @vimeo for encouragement and patience, especially @nbeliard, @erunion and @nickyr.