1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00
psalm/README.md

55 lines
2.2 KiB
Markdown
Raw Normal View History

2019-02-22 17:47:55 +01:00
<h1><a href="https://psalm.dev"><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)
2018-01-23 23:25:42 +01:00
[![Packagist](https://img.shields.io/packagist/dt/vimeo/psalm.svg)](https://packagist.org/packages/vimeo/psalm)
2017-02-09 07:54:41 +01:00
[![Travis CI](https://img.shields.io/travis/vimeo/psalm/master.svg)](https://travis-ci.org/vimeo/psalm/branches)
[![Coverage Status](https://coveralls.io/repos/github/vimeo/psalm/badge.svg)](https://coveralls.io/github/vimeo/psalm)
2019-03-31 20:02:30 +02:00
![Psalm coverage](https://shepherd.dev/github/vimeo/psalm/coverage.svg?)
2019-03-24 14:47:39 +01:00
2018-02-22 02:09:30 +01: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-05 05:19:14 +01:00
2018-08-25 17:30:31 +02:00
It's able to find a [large number of 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 20:19:31 +01:00
2019-03-05 17:04:17 +01:00
[Try a live demo](https://psalm.dev/), or install it in your project by following the Quickstart Guide below.
## Psalm documentation
2019-03-05 17:04:17 +01:00
Documentation is available on [Psalms website](https://psalm.dev/docs), generated from the [docs](https://github.com/vimeo/psalm/blob/master/docs) folder.
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
```
2017-02-13 06:16:22 +01:00
Add a config:
2016-11-21 21:15:23 +01:00
```bash
2017-02-13 06:14:20 +01:00
./vendor/bin/psalm --init
2016-11-21 21:15:23 +01:00
```
2017-02-13 06:14:20 +01:00
Then run Psalm:
2016-11-21 21:15:23 +01:00
```bash
./vendor/bin/psalm
```
2018-10-27 18:54:13 +02: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 06:16:22 +01:00
```bash
./vendor/bin/psalm --init [source_dir] [level]
```
2018-02-22 02:09:30 +01: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 23:20:07 +01:00
## How Psalm Works
A basic rundown of Psalms 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 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).