Skip to content

Latest commit

 

History

History
18 lines (11 loc) · 1.27 KB

File metadata and controls

18 lines (11 loc) · 1.27 KB

This page documents deprecated plugin APIs. V1 plugins were removed in Phan 1.0.0. V2 plugins were deprecated in Phan 2.0.0. For current plugin development, see [[Writing Plugins for Phan]].

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.

Creating a Plugin (Legacy)

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 the plugin 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.