PHPackages                             trash-panda/m2-callable-event-listeners - 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. trash-panda/m2-callable-event-listeners

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

trash-panda/m2-callable-event-listeners
=======================================

Listen to events with plain PHP callable minus any configuration

1.2.0(6y ago)61.5k2MITPHPPHP &gt;=7.0 &lt;7.3

Since Feb 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/AydinHassan/m2-callable-event-listeners)[ Packagist](https://packagist.org/packages/trash-panda/m2-callable-event-listeners)[ RSS](/packages/trash-panda-m2-callable-event-listeners/feed)WikiDiscussions master Synced today

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

Magento 2 Callable Event Listeners
==================================

[](#magento-2-callable-event-listeners)

Allow to register event listeners with a plain PHP callable - minus the config.

Installation
------------

[](#installation)

```
$ composer require trash-panda/m2-callable-event-listeners
$ php bin/magento setup:upgrade
```

Usage
-----

[](#usage)

Grab an instance of `\TrashPanda\CallableEventListeners\Model\Manager` either via DI or from the object manager and pass an event name and a callable to the `listen` method.

```
use TrashPanda\CallableEventListeners\Model\Manager;
use Magento\Framework\Event\Observer;

class MyCommand
{
    public function ___construct(Manager $manager)
    {
        $manager->listen('some-event', function (Observer $observer) {
            echo "Hey!\n\n";
            var_dump($observer->getData());
        });
    }
}
```

Now when the event `some-event` is dispatched from `\Magento\Framework\Event\Manager` your callable will be invoked along with any other listeners attached via config.

Use Cases
---------

[](#use-cases)

- Scoping events to one particular code path - eg a command or a cron
- Prototyping
- Improved feedback from IDE - regarding classes and method existence

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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

Every ~491 days

Total

3

Last Release

2445d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.2.0PHP &gt;=7.0 &lt;7.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2817002?v=4)[Aydin Hassan](/maintainers/AydinHassan)[@AydinHassan](https://github.com/AydinHassan)

---

Top Contributors

[![AydinHassan](https://avatars.githubusercontent.com/u/2817002?v=4)](https://github.com/AydinHassan "AydinHassan (9 commits)")

---

Tags

event-listenereventsmagentomagento2magento2-extension

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/trash-panda-m2-callable-event-listeners/health.svg)

```
[![Health](https://phpackages.com/badges/trash-panda-m2-callable-event-listeners/health.svg)](https://phpackages.com/packages/trash-panda-m2-callable-event-listeners)
```

###  Alternatives

[magenest/module-multiple-wishlist

Multiple Wishlist extension by Magenest

193.5k](/packages/magenest-module-multiple-wishlist)

PHPackages © 2026

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