1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
psalm/README.md

55 lines
1.9 KiB
Markdown
Raw Normal View History

2016-12-12 21:32:01 +01:00
<h1><a href="https://getpsalm.org"><img src="PsalmLogo.png" height="64" alt="logo" /></a></h1>
2016-07-18 22:46:44 +02:00
[![Packagist](https://img.shields.io/packagist/v/vimeo/psalm.svg)](https://packagist.org/packages/vimeo/psalm)
[![Travis CI](http://img.shields.io/travis/vimeo/psalm.svg?branch=master)](https://travis-ci.org/vimeo/psalm)
2016-12-05 05:19:14 +01:00
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.
2016-12-12 16:29:43 +01:00
- **v0.2.x** supports checking PHP 5.4 - 7.0 code and requires **PHP 5.4+** to run.
2016-11-11 20:19:31 +01:00
2016-12-12 18:02:31 +01:00
Check out the [wiki](https://github.com/vimeo/psalm/wiki) or [try a live demo](https://getpsalm.org/)!
2016-11-21 21:15:23 +01:00
## Quickstart Guide
Install via [Composer](https://getcomposer.org/):
```bash
composer require --dev vimeo/psalm
2016-11-21 21:15:23 +01:00
```
Add a `psalm.xml` config:
```bash
cat > psalm.xml << EOF
<?xml version="1.0"?>
<psalm
stopOnFirstError="false"
useDocblockTypes="true"
>
2016-12-30 02:07:42 +01:00
<projectFiles>
2016-11-21 21:15:23 +01:00
<directory name="src" />
2016-12-30 02:07:42 +01:00
</projectFiles>
<issueHandlers>
<MissingReturnType errorLevel="info" />
<MissingClosureReturnType errorLevel="info" />
<MissingPropertyType errorLevel="info" />
</issueHandlers>
2016-11-21 21:15:23 +01:00
</psalm>
EOF
```
Then run Psalm with:
```bash
./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](examples/psalm.default.xml), and you can learn about how to suppress certain issues [here](https://github.com/vimeo/psalm/wiki/Dealing-with-code-issues).
2017-01-16 23:20:07 +01: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.