1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-27 04:45:20 +01:00
psalm/docs/running_psalm/installation.md
2019-12-18 15:35:18 +00:00

38 lines
886 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Installation
Psalm Requires PHP >= 7.1 and [Composer](https://getcomposer.org/).
```bash
composer require --dev vimeo/psalm
```
Add a `psalm.xml` config:
```bash
./vendor/bin/psalm --init [source_directory=src] [config_level=3]
```
where `config_level` represents how strict you want Psalm to be. `1` is the strictest, `8` is the most lenient.
Example:
```console
$ ./vendor/bin/psalm --init src 3
Config file created successfully. Please re-run psalm.
```
Then run Psalm:
```bash
./vendor/bin/psalm
```
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).
## Using the Phar
Sometimes your project can conflict with one or more of Psalms dependencies.
In that case you may find the Phar (a self-contained PHP executable) useful.
Run `composer require --dev psalm/phar` to install it.