2018-02-17 19:53:17 -05:00
|
|
|
# Installation
|
|
|
|
|
2019-05-29 23:50:24 -04:00
|
|
|
Psalm Requires PHP >= 7.1 and [Composer](https://getcomposer.org/).
|
2018-02-17 19:53:17 -05:00
|
|
|
|
|
|
|
```bash
|
2018-04-15 10:56:43 -04:00
|
|
|
composer require --dev vimeo/psalm
|
|
|
|
```
|
|
|
|
|
|
|
|
Add a `psalm.xml` config:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./vendor/bin/psalm --init [source_directory=src] [config_level=3]
|
|
|
|
```
|
|
|
|
|
2018-04-19 01:03:28 -04:00
|
|
|
where `config_level` represents how strict you want Psalm to be. `1` is the strictest, `8` is the most lenient.
|
2018-04-15 12:17:07 -04:00
|
|
|
|
2019-02-11 02:38:26 +02:00
|
|
|
Example:
|
|
|
|
```console
|
|
|
|
$ ./vendor/bin/psalm --init src 3
|
|
|
|
Config file created successfully. Please re-run psalm.
|
|
|
|
```
|
|
|
|
|
2018-04-15 10:56:43 -04:00
|
|
|
Then run Psalm:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
./vendor/bin/psalm
|
2018-02-17 19:53:17 -05:00
|
|
|
```
|
2019-03-19 12:08:22 -04:00
|
|
|
|
|
|
|
Psalm will probably find a number of issues - find out how to deal with them in [Dealing with code issues](dealing_with_code_issues.md).
|