2016-12-12 15:32:01 -05:00
< h1 > < a href = "https://getpsalm.org" > < img src = "PsalmLogo.png" height = "64" alt = "logo" / > < / a > < / h1 >
2016-07-18 16:46:44 -04:00
2017-02-03 21:35:40 -05:00
[![Packagist ](https://img.shields.io/packagist/v/vimeo/psalm.svg )](https://packagist.org/packages/vimeo/psalm)
2018-01-23 17:25:42 -05:00
[![Packagist ](https://img.shields.io/packagist/dt/vimeo/psalm.svg )](https://packagist.org/packages/vimeo/psalm)
2017-02-09 01:54:41 -05:00
[![Travis CI ](https://img.shields.io/travis/vimeo/psalm/master.svg )](https://travis-ci.org/vimeo/psalm/branches)
2017-12-14 00:40:22 -05:00
[![Coverage Status ](https://coveralls.io/repos/github/vimeo/psalm/badge.svg )](https://coveralls.io/github/vimeo/psalm)
2017-02-03 21:35:40 -05:00
2018-02-21 20:09:30 -05:00
Psalm is a static analysis tool for finding errors in PHP applications, built on top of [PHP Parser ](https://github.com/nikic/php-parser ).
2016-12-04 23:19:14 -05:00
2018-02-21 20:09:30 -05:00
It's able to find a [large number issues ](https://github.com/vimeo/psalm/blob/master/docs/issues.md ), but it can also be configured to only care about a small subset of those.
2016-11-11 14:19:31 -05:00
2018-03-18 09:07:36 -04:00
[Try a live demo ](https://getpsalm.org/ ), or install it in your project by following the Quickstart Guide below.
## Psalm documentation
2018-03-18 09:08:32 -04:00
All the documentation for Psalm is found in the docs folder - [the index is located here ](https://github.com/vimeo/psalm/blob/master/docs/index.md ),
2016-11-21 15:15:23 -05:00
## Quickstart Guide
Install via [Composer ](https://getcomposer.org/ ):
```bash
2017-01-17 13:51:36 +01:00
composer require --dev vimeo/psalm
2016-11-21 15:15:23 -05:00
```
2017-02-13 00:16:22 -05:00
Add a config:
2016-11-21 15:15:23 -05:00
```bash
2017-02-13 00:14:20 -05:00
./vendor/bin/psalm --init
2016-11-21 15:15:23 -05:00
```
2017-02-13 00:14:20 -05:00
Then run Psalm:
2016-11-21 15:15:23 -05:00
```bash
./vendor/bin/psalm
```
2018-02-21 20:09:30 -05:00
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
2017-02-13 00:16:22 -05:00
```bash
./vendor/bin/psalm --init [source_dir] [level]
```
2018-02-21 20:09:30 -05:00
You can also [learn how to suppress certain issues ](https://github.com/vimeo/psalm/blob/master/docs/dealing_with_code_issues.md ).
2017-01-16 17:20:07 -05:00
2018-01-14 15:35:52 -05:00
## How Psalm Works
A basic rundown of Psalm’ s internals can be found in [docs/how_psalm_works.md ](https://github.com/vimeo/psalm/blob/master/docs/how_psalm_works.md ).
2017-01-16 17:20:07 -05:00
## Acknowledgements
The engineering team [@vimeo ](https://github.com/vimeo ) for encouragement and patience, especially [@nbeliard ](https://github.com/nbeliard ), [@erunion ](https://github.com/erunion ) and [@nickyr ](https://github.com/nickyr ).