PHPackages                             power-modules/plugin - 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. [Framework](/categories/framework)
4. /
5. power-modules/plugin

ActiveLibrary[Framework](/categories/framework)

power-modules/plugin
====================

A modular plugin component for the Power Modules framework, enabling seamless integration and extension of functionalities.

v1.0.0(9mo ago)062↓66.7%2MITPHPPHP ^8.4CI passing

Since Sep 29Pushed 3mo agoCompare

[ Source](https://github.com/power-modules/plugin)[ Packagist](https://packagist.org/packages/power-modules/plugin)[ RSS](/packages/power-modules-plugin/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (4)Versions (2)Used By (2)

Plugin System Extension
=======================

[](#plugin-system-extension)

[![CI](https://github.com/power-modules/plugin/actions/workflows/php.yml/badge.svg)](https://github.com/power-modules/plugin/actions/workflows/php.yml)[![Packagist Version](https://camo.githubusercontent.com/b36247f6a5ebc9e0228c9dad5ce865c20715781b1566bf779d85467488a88f1b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f706f7765722d6d6f64756c65732f706c7567696e)](https://packagist.org/packages/power-modules/plugin)[![PHP Version](https://camo.githubusercontent.com/c099b296ec94ef84ac8b42ec3b455a9912a3870dcca07c28ed1c99630f592104/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f706f7765722d6d6f64756c65732f706c7567696e)](https://packagist.org/packages/power-modules/plugin)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](LICENSE)[![PHPStan](https://camo.githubusercontent.com/1b02b2f6c2946c9b9ad2e14b1c79c5932fdcef4ea31b4d6e79d54af7d7e7a2a7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d6c6576656c253230382d626c7565)](#)

A plugin architecture library for the Power Modules framework that uses PHPDoc generics for IDE/PHPStan type safety, enabling extensible plugin systems with automatic discovery, dependency injection, and seamless integration.

> **🔌 Extensible:** Designed for applications that need third-party extensions, dynamic feature loading, or modular plugin architectures.

✨ Architectural Vision
----------------------

[](#-architectural-vision)

The Plugin System Extension is not just an add-on; it's a foundational library that brings a new level of type safety and developer experience to building extensible PHP applications. It is built on the principle that plugins should be first-class citizens in the application architecture, with full access to dependency injection and module encapsulation.

Our goal is to provide a system that is both powerful and easy to use, enabling developers to create complex plugin-based systems with confidence.

🚀 Quick Start
-------------

[](#-quick-start)

```
composer require power-modules/plugin
```

Define a plugin, provide it from a module, and the framework handles the rest.

```
use Modular\Framework\Container\ConfigurableContainerInterface;
use Modular\Framework\PowerModule\Contract\PowerModule;
use Modular\Plugin\Contract\Plugin;
use Modular\Plugin\Contract\PluginRegistry;
use Modular\Plugin\Contract\ProvidesPlugins;
use Modular\Plugin\PluginMetadata;

// 1. Define a plugin
final class MyPlugin implements Plugin
{
    public static function getPluginMetadata(): PluginMetadata
    {
        return new PluginMetadata('My Plugin', '1.0.0', 'Example plugin');
    }
}

// 2. Provide it from a module
final class MyModule implements PowerModule, ProvidesPlugins
{
    public static function getPlugins(): array
    {
        return [PluginRegistry::class => [MyPlugin::class]];
    }

    public function register(ConfigurableContainerInterface $container): void
    {
        $container->set(MyPlugin::class, MyPlugin::class);
    }
}

// 3. The application automatically discovers and registers it
$app = (new ModularAppBuilder(__DIR__))
    ->withPowerSetup(...PluginRegistrySetup::withDefaults())
    ->withModules(MyModule::class)
    ->build();

// 4. Use it
/** @var PluginRegistry $registry */
$registry = $app->get(PluginRegistry::class);
$plugin = $registry->makePlugin(MyPlugin::class);
```

📚 Documentation
---------------

[](#-documentation)

**📖 [Complete Documentation Hub](docs/README.md)** - Comprehensive guides, examples, and API reference.

**Quick Links:**

- **[Getting Started](docs/getting-started.md)** - Build your first plugin in 5 minutes.
- **[Architecture Guide](docs/architecture.md)** - Deep dive into the plugin system's internals.
- **[API Reference](docs/api-reference.md)** - Complete interface and class documentation.

🌟 Key Features
--------------

[](#-key-features)

- **Enhanced Developer Experience**: Generic annotations provide better IDE support and static analysis.
- **Automatic Discovery**: `PluginRegistrySetup` scans modules implementing `ProvidesPlugins` and registers declared plugin classes.
- **Lazy Loading**: Plugins are instantiated only when requested through registries.
- **Container Integration**: Full dependency injection support for plugins.
- **Multiple Registries**: Support for specialized plugin types with custom registries.
- **Framework Native**: Built specifically for the Power Modules architecture.

Contributing
------------

[](#contributing)

See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

---

*The Plugin System Extension enables your Power Modules application to support rich plugin architectures with type safety, automatic discovery, and full dependency injection support.*

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance70

Regular maintenance activity

Popularity11

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% of commits — single point of failure

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

Unknown

Total

1

Last Release

278d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12776808?v=4)[HomelessCoder](/maintainers/HomelessCoder)[@HomelessCoder](https://github.com/HomelessCoder)

---

Top Contributors

[![HomelessCoder](https://avatars.githubusercontent.com/u/12776808?v=4)](https://github.com/HomelessCoder "HomelessCoder (4 commits)")[![unfinished-tourist](https://avatars.githubusercontent.com/u/250381748?v=4)](https://github.com/unfinished-tourist "unfinished-tourist (1 commits)")

---

Tags

frameworkdi containerdependency-injectionmodularecosystemmicroservicesmodular-architecturecomponent-basedplugin-systempower-modulesencapsulationpowermodulesetup

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/power-modules-plugin/health.svg)

```
[![Health](https://phpackages.com/badges/power-modules-plugin/health.svg)](https://phpackages.com/packages/power-modules-plugin)
```

###  Alternatives

[gdg-tangier/cloud-pubsub

Google Cloud pub-sub for laravel

5057.7k](/packages/gdg-tangier-cloud-pubsub)

PHPackages © 2026

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