-
Notifications
You must be signed in to change notification settings - Fork 368
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.phpunder thepluginarray.
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 V6
-
About Union Types
-
Tutorial for Analyzing a Large Sloppy Code Base
-
Incrementally Strengthening Analysis
-
Issue Types Reference
-
Phan Config Settings
-
Typing Parameters
-
How To Use Stubs
-
Migrating to Phan V6
-
PHP 8.4 and 8.5 Support
-
Using Phan From the Command Line
-
Incremental Analysis
-
Memory and Performance Optimizations
-
Phan Helpers Extension
-
Tooling and Suppression Baselines