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
2016-12-04 23:19:14 -05:00
Psalm is a static analysis tool for finding errors in PHP applications.
2017-05-02 12:23:53 -04:00
- **v0.3.x** supports checking PHP 5.4 - 7.1 code, and requires **PHP 5.6+** to run.
2016-12-12 10:29:43 -05:00
- **v0.2.x** supports checking PHP 5.4 - 7.0 code and requires **PHP 5.4+** to run.
2016-11-11 14:19:31 -05:00
2016-12-12 12:02:31 -05:00
Check out the [wiki ](https://github.com/vimeo/psalm/wiki ) or [try a live demo ](https://getpsalm.org/ )!
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
```
2017-02-13 00:16:22 -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
```bash
./vendor/bin/psalm --init [source_dir] [level]
```
2017-02-13 00:18:49 -05:00
You can also [learn how to suppress certain issues ](https://github.com/vimeo/psalm/wiki/Dealing-with-code-issues ).
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 ).
Thanks also to [@nikic ](https://github.com/nikic ) for creating the excellent [php-parser ](https://github.com/nikic/php-parser ), on top of which Psalm is built.