mediawiki / phan-utils
Utilities for phan to be used in plugins, originally developed for taint-check-plugin
Installs: 40
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 19
Forks: 0
pkg:composer/mediawiki/phan-utils
Requires
- php: ^7.2.0
- phan/phan: ^2.6.1
Requires (Dev)
This package is auto-updated.
Last update: 2025-09-12 18:43:50 UTC
README
This repo contains some utilities that can be used when developing Phan plugins. This code was originally written as part of MediaWiki's taint-check.
Install
$ `composer require mediawiki/phan-utils`
Usage
Add use MediaWikiPhanUtils\MediaWikiPhanUtils
to the visitor class. Note that the implementing class
MUST have the following properties:
/**
* @property \Phan\Language\Context $context
* @property \Phan\CodeBase $code_base
*/
Additionally, the class SHOULD implement the following method:
protected function getLogChannel() : string
to specify the name of the channel used in debug logs.
Environment variables
You can use the PHAN_DEBUG
variable to print debug information. The variable can take
the name of a file (if running from shell, /dev/stderr is convenient), or -
for stdout.