PHPackages                             automattic/jetpack-phan-plugins - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Templating &amp; Views](/categories/templating)
4. /
5. automattic/jetpack-phan-plugins

ActiveLibrary[Templating &amp; Views](/categories/templating)

automattic/jetpack-phan-plugins
===============================

Phan plugins created for the Jetpack monorepo.

v0.1.3(4mo ago)171GPL-2.0-or-laterPHPPHP &gt;=8.0CI failing

Since Aug 29Pushed 1mo ago2 watchersCompare

[ Source](https://github.com/Automattic/jetpack-phan-plugins)[ Packagist](https://packagist.org/packages/automattic/jetpack-phan-plugins)[ RSS](/packages/automattic-jetpack-phan-plugins/feed)WikiDiscussions trunk Synced 1mo ago

READMEChangelogDependencies (4)Versions (6)Used By (0)

phan-plugins
============

[](#phan-plugins)

Phan plugins created for the Jetpack monorepo.

Usage
-----

[](#usage)

Install with

```
composer require --dev automattic/jetpack-phan-plugins

```

Then add reference to the appropriate plugins from `vendor/automattic/jetpack-phan-plugins/src/` into your Phan config `'plugins'` array.

Plugins
-------

[](#plugins)

### HtmlTemplatePlugin

[](#htmltemplateplugin)

An "html template" file is a PHP file that produces a fragment of HTML, loaded by a method or function call somewhere else in the codebase something like this:

```
function load_template( $name ) {
	$some_var = $this->get_some_var();
	require __DIR__ . "/templates/$name.php";
}

```

Phan will normally evaluate the template as being in the global scope, meaning it doesn't know about `$this` or `$some_var` and will complain about attempts to access them.

Enter this plugin. First, in a comment at the top of the file (i.e. before any actual code, even `namespace`), add `@html-template ` (where `` is like `Namespace\Classname::method_name` or `Namespace\function_name`). This tells Phan that the file should be interpreted inside the context of the named function or method, including access to `$this` if appropriate.

Second, in either the template's file comments or the doc comment for the referenced method/function, include `@html-template-var T $var`, just like `@param` or `@var`, to declare any additional variables that the method/function provides to the templates it loads.

Security
--------

[](#security)

Need to report a security vulnerability? Go to  or directly to our security bug bounty site .

License
-------

[](#license)

phan-plugins is licensed under [GNU General Public License v2 (or later)](./LICENSE.txt)

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance85

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~166 days

Total

4

Last Release

125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7c5869ecbb8e0eac7e8b8e0f3cf7bdd8d5fcdc4abc10a72281872c53f8639d44?d=identicon)[automattic](/maintainers/automattic)

![](https://www.gravatar.com/avatar/d48ad8a33091a43b53f295c6a6f25a03339f4e89032b74259d85e14e5317cd2b?d=identicon)[anomie](/maintainers/anomie)

---

Top Contributors

[![anomiex](https://avatars.githubusercontent.com/u/1030580?v=4)](https://github.com/anomiex "anomiex (27 commits)")[![tbradsha](https://avatars.githubusercontent.com/u/32492176?v=4)](https://github.com/tbradsha "tbradsha (21 commits)")[![manzoorwanijk](https://avatars.githubusercontent.com/u/18226415?v=4)](https://github.com/manzoorwanijk "manzoorwanijk (3 commits)")[![gmjuhasz](https://avatars.githubusercontent.com/u/36671565?v=4)](https://github.com/gmjuhasz "gmjuhasz (2 commits)")[![Initsogar](https://avatars.githubusercontent.com/u/1488641?v=4)](https://github.com/Initsogar "Initsogar (1 commits)")[![sergeymitr](https://avatars.githubusercontent.com/u/1341249?v=4)](https://github.com/sergeymitr "sergeymitr (1 commits)")[![adamwoodnz](https://avatars.githubusercontent.com/u/1017872?v=4)](https://github.com/adamwoodnz "adamwoodnz (1 commits)")[![zinigor](https://avatars.githubusercontent.com/u/374293?v=4)](https://github.com/zinigor "zinigor (1 commits)")[![CGastrell](https://avatars.githubusercontent.com/u/157240?v=4)](https://github.com/CGastrell "CGastrell (1 commits)")[![chihsuan](https://avatars.githubusercontent.com/u/4344253?v=4)](https://github.com/chihsuan "chihsuan (1 commits)")[![haqadn](https://avatars.githubusercontent.com/u/3737780?v=4)](https://github.com/haqadn "haqadn (1 commits)")

---

Tags

pluginstatic analysistemplatingphan

### Embed Badge

![Health badge](/badges/automattic-jetpack-phan-plugins/health.svg)

```
[![Health](https://phpackages.com/badges/automattic-jetpack-phan-plugins/health.svg)](https://phpackages.com/packages/automattic-jetpack-phan-plugins)
```

###  Alternatives

[twig/twig

Twig, the flexible, fast, and secure template language for PHP

8.4k443.2M5.8k](/packages/twig-twig)[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[smarty/smarty

Smarty - the compiling PHP template engine

2.3k39.1M395](/packages/smarty-smarty)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7526.3M230](/packages/laminas-laminas-view)[shoot/shoot

Shoot aims to make providing data to your templates more manageable

40229.9k2](/packages/shoot-shoot)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
