PHPackages                             wyrihaximus/generative-composer-plugin-tooling - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wyrihaximus/generative-composer-plugin-tooling

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wyrihaximus/generative-composer-plugin-tooling
==============================================

🐦‍🔥 Generative Composer Plugin Tooling

1.5.0(2mo ago)2115.1k↑1100%[1 issues](https://github.com/WyriHaximus/php-generative-composer-plugin-tooling/issues)2MITPHPPHP ^8.4CI passing

Since Jul 27Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/WyriHaximus/php-generative-composer-plugin-tooling)[ Packagist](https://packagist.org/packages/wyrihaximus/generative-composer-plugin-tooling)[ GitHub Sponsors](https://github.com/WyriHaximus)[ RSS](/packages/wyrihaximus-generative-composer-plugin-tooling/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (12)Versions (23)Used By (2)

php-generative-composer-plugin-tooling
======================================

[](#php-generative-composer-plugin-tooling)

Tooling for creating generative Composer Plugins

[![Continuous Integration](https://github.com/wyrihaximus/php-generative-composer-plugin-tooling/workflows/Continuous%20Integration/badge.svg)](https://github.com/wyrihaximus/php-generative-composer-plugin-tooling/workflows/Continuous%20Integration/badge.svg)[![Latest Stable Version](https://camo.githubusercontent.com/9320f15c3611a6fac7b0a6617922b85f27f7fa583e688a7973d188982632a5af/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f67656e657261746976652d636f6d706f7365722d706c7567696e2d746f6f6c696e672f762f737461626c652e706e67)](https://packagist.org/packages/wyrihaximus/generative-composer-plugin-tooling)[![Total Downloads](https://camo.githubusercontent.com/fa0698442e2459cefec00d15c976998544fa3df5ec46233db0f6b1112d16d2fc/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f67656e657261746976652d636f6d706f7365722d706c7567696e2d746f6f6c696e672f646f776e6c6f6164732e706e67)](https://packagist.org/packages/wyrihaximus/generative-composer-plugin-tooling/stats)[![Type Coverage](https://camo.githubusercontent.com/aef9624c017a6248b3853440ccd5720435145f3efbe3032700f35727e7aa4edf/68747470733a2f2f73686570686572642e6465762f6769746875622f57797269486178696d75732f7068702d67656e657261746976652d636f6d706f7365722d706c7567696e2d746f6f6c696e672f636f7665726167652e737667)](https://shepherd.dev/github/WyriHaximus/php-generative-composer-plugin-tooling)[![License](https://camo.githubusercontent.com/dc26480cc4b32671e1878b3a6ae2f08845cea943ed85990020f72bb850d9a75e/68747470733a2f2f706f7365722e707567782e6f72672f77797269686178696d75732f67656e657261746976652d636f6d706f7365722d706c7567696e2d746f6f6c696e672f6c6963656e73652e706e67)](https://packagist.org/packages/wyrihaximus/generative-composer-plugin-tooling)

The main goal of this package is to take the repetitive annoying parts composer plugins that generate code out of hands. And make it so you can focus on the details. The usage example below is based on [`wyrihaximus/broadcast`](https://github.com/wyrihaximus/php-broadcast) as it generates a listener provider based on marker interfaces:

We start with setting up our package to be a composer plugin and how composer can call the plugin:

```
{
  "name": "wyrihaximus/broadcast",
  "type": "composer-plugin",
  "extra": {
    "class": "WyriHaximus\\Broadcast\\Composer\\Installer"
  },
  "scripts": {
    "pre-autoload-dump": [
      "WyriHaximus\\Broadcast\\Composer\\Installer::findEventListeners"
    ]
  }
}
```

We also have a pretty standard plugin class that delegates the work to the `GenerativePluginExecutioner`:

```
