From 8fd45d955e7f94dc88eab86c597b5db3b7293ee6 Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Thu, 5 Jul 2018 01:58:06 +0300 Subject: [PATCH] documented previously undocumented plugin methods --- docs/plugins.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/plugins.md b/docs/plugins.md index 50e078b8252..b753edea81f 100644 --- a/docs/plugins.md +++ b/docs/plugins.md @@ -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. @@ -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).