-
Notifications
You must be signed in to change notification settings - Fork 371
Writing Legacy Plugins for Phan
Tyson Andre edited this page Aug 1, 2021
·
7 revisions
The original plugin types will work in all known versions of Phan, and must be used for Phan <= 0.8.4, but won't be as efficient as V2 plugins.
Support for v1 plugins was removed in Phan 1.0.0. v2 plugins were deprecated in Phan 2.0.0 in favor of PluginV3.
To create a plugin, you'll need to
- Create a plugin file for which the last line returns an instance of a class extending
\Phan\Plugin
- Add a reference to the file in
.phan/config.php
under theplugin
array.
Phan contains an example plugin named DemoLegacyPlugin that is referenced from Phan's .phan/config.php file.
A more meaningful real-world example is given in DollarDollarPlugin which checks to make sure there are no variables of the form $$var
in Phan's code base.
-
Getting Started
-
Annotating Your Source Code
-
About Union Types
-
Tutorial for Analyzing a Large Sloppy Code Base
-
Incrementally Strengthening Analysis
-
Issue Types Caught by Phan
-
Phan Config Settings
-
Typing Parameters
-
How To Use Stubs
-
Speeding up Phan Analysis