2018-02-18 01:53:17 +01:00
|
|
|
|
# Installation
|
|
|
|
|
|
2019-05-30 05:50:24 +02:00
|
|
|
|
Psalm Requires PHP >= 7.1 and [Composer](https://getcomposer.org/).
|
2018-02-18 01:53:17 +01:00
|
|
|
|
|
|
|
|
|
```bash
|
2018-04-15 16:56:43 +02:00
|
|
|
|
composer require --dev vimeo/psalm
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
Add a `psalm.xml` config:
|
|
|
|
|
|
|
|
|
|
```bash
|
2020-02-17 22:49:54 +01:00
|
|
|
|
./vendor/bin/psalm --init
|
2018-04-15 16:56:43 +02:00
|
|
|
|
```
|
|
|
|
|
|
2020-02-17 22:49:54 +01:00
|
|
|
|
Psalm will scan your project and figure out an appropriate [error level](error_levels.md) for your codebase.
|
2019-02-11 01:38:26 +01:00
|
|
|
|
|
2018-04-15 16:56:43 +02:00
|
|
|
|
Then run Psalm:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
./vendor/bin/psalm
|
2018-02-18 01:53:17 +01:00
|
|
|
|
```
|
2019-03-19 17:08:22 +01: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).
|
2019-12-18 16:35:18 +01:00
|
|
|
|
|
|
|
|
|
## Using the Phar
|
|
|
|
|
|
|
|
|
|
Sometimes your project can conflict with one or more of Psalm’s dependencies.
|
|
|
|
|
|
|
|
|
|
In that case you may find the Phar (a self-contained PHP executable) useful.
|
|
|
|
|
|
|
|
|
|
Run `composer require --dev psalm/phar` to install it.
|