Skip to content

Commit

Permalink
documented previously undocumented plugin methods
Browse files Browse the repository at this point in the history
  • Loading branch information
weirdan committed Jul 9, 2018
1 parent bc33247 commit 8fd45d9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions docs/plugins.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Plugins
# Legacy plugins

Note: this is a legacy subsystem, being replaced with a new, composer-based one.

Psalm can be extended through plugins to find domain-specific issues.

Expand All @@ -12,9 +14,13 @@ class SomePlugin extends \Psalm\Plugin
return new SomePlugin;
```

`Psalm\Plugin` offers two methods that you can override:
`Psalm\Plugin` offers six methods that you can override:
- `afterStatementsCheck` - called after Psalm evaluates each statement
- `afterExpressionCheck` - called after Psalm evaluates each expression
- `afterVisitClassLike` - called after Psalm scans(?) a class-like (class,interface,trait)
- `afterClassLikeExistsCheck` - called after Psalm analized a reference to a class-like
- `afterMethodCallCheck` - called after Psalm analized a method call
- `afterFunctionCallCheck` - called after Psalm analized a function call

An example plugin that checks class references in strings is provided [here](https://github.com/vimeo/psalm/blob/master/examples/StringChecker.php).

Expand Down

0 comments on commit 8fd45d9

Please sign in to comment.