1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 17:52:45 +01:00
psalm/docs/running_psalm/plugins/using_plugins.md

32 lines
1.2 KiB
Markdown
Raw Permalink Normal View History

2019-04-14 21:21:41 +02:00
# Using Plugins
Psalm can be extended through plugins to find and fix domain-specific issues.
## Using Composer-based plugins
2020-05-14 13:47:55 +02:00
Psalm plugins are distributed as composer packages.
2019-04-14 21:21:41 +02:00
### Discovering plugins
2020-10-03 16:23:55 +02:00
You can find a list of plugins on [Psalms own website](https://psalm.dev/plugins), and [also on Packagist](https://packagist.org/?type=psalm-plugin). Alternatively you can get a list via the CLI by typing `composer search -t psalm-plugin '.'`
2019-04-14 21:21:41 +02:00
### Installing plugins
2020-05-14 13:47:55 +02:00
`composer require --dev <plugin-vendor/plugin-package>`
2019-04-14 21:21:41 +02:00
### Managing known plugins
Once installed, use the `psalm-plugin` tool to enable, disable and show available and enabled plugins.
2019-04-14 21:21:41 +02:00
To enable a plugin, run `vendor/bin/psalm-plugin enable plugin-vendor/plugin-package`.
To disable a plugin, run `vendor/bin/psalm-plugin disable plugin-vendor/plugin-package`.
`vendor/bin/psalm-plugin show` will show you a list of all local plugins (enabled and disabled).
2019-04-14 21:21:41 +02:00
2020-05-14 13:47:55 +02:00
## Using your own plugins
Is there no plugin for your favourite framework / library yet? Create it! It's as easy as forking a repository, tweaking some docblocks and publishing the package to Packagist.
Consult [Authoring Plugins](authoring_plugins.md) chapter to get started.