1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
Go to file
2017-02-07 18:27:28 -05:00
bin Add unused method & unused class analysis ref #80 2017-01-31 20:47:16 -05:00
examples Fix phpcs errors 2017-01-16 19:06:39 -05:00
src/Psalm Remove dead code and fix config.xsd 2017-02-07 18:27:28 -05:00
tests Fix #87 - array types from docblocks can be reasoned about safely 2017-02-03 22:07:14 -05:00
.gitignore Fixing a typo in the .gitignore filename. 2016-10-20 11:52:14 -04:00
.travis.yml Remove nightly from master due to PhpUnit issue 2017-01-29 00:29:07 -05:00
composer.json Bump PhpParser version 2017-02-03 20:14:48 -05:00
composer.lock Bump PhpParser version 2017-02-03 20:14:48 -05:00
config.xsd Remove dead code and fix config.xsd 2017-02-07 18:27:28 -05:00
LICENSE Add license 2016-11-21 14:48:17 -05:00
phpcs.xml Move string-stored types into named classes 2017-01-15 10:22:05 -05:00
phpunit.xml Update PHPUnit to version without count bug 2016-12-23 21:50:31 +00:00
psalm.xml Remove dead code and fix config.xsd 2017-02-07 18:27:28 -05:00
PsalmLogo.png New and improved logo 2017-01-16 17:24:26 -05:00
README.md Making the README badges clickable, and adding one for Packagist. 2017-02-03 21:35:40 -05:00

logo

Packagist Travis CI

Psalm is a static analysis tool for finding errors in PHP applications.

  • v0.3.x supports checking PHP 5.4 - 7.1 code, and requires PHP 5.5+ to run.
  • v0.2.x supports checking PHP 5.4 - 7.0 code and requires PHP 5.4+ to run.

Check out the wiki or try a live demo!

Quickstart Guide

Install via Composer:

composer require --dev vimeo/psalm

Add a psalm.xml config:

cat > psalm.xml << EOF
<?xml version="1.0"?>
<psalm
  stopOnFirstError="false"
  useDocblockTypes="true"
>
    <projectFiles>
        <directory name="src" />
    </projectFiles>
    <issueHandlers>
        <MissingReturnType errorLevel="info" />
        <MissingClosureReturnType errorLevel="info" />
        <MissingPropertyType errorLevel="info" />
    </issueHandlers>
</psalm>
EOF

Then run Psalm with:

./vendor/bin/psalm

The above config is fairly spartan, and will show you all possible errors, including many that might be irrelevant to you. A more lenient config is provided here, and you can learn about how to suppress certain issues here.

Acknowledgements

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

Thanks also to @nikic for creating the excellent php-parser, on top of which Psalm is built.