PHPackages                             bwoester/yii-event-interceptor - 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. bwoester/yii-event-interceptor

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

bwoester/yii-event-interceptor
==============================

A component, that allows to intercept events raised by observed components.

v1.0.2(11y ago)511.4k21BSD-2-ClausePHPPHP &gt;=5.1.0

Since Oct 21Pushed 11y ago1 watchersCompare

[ Source](https://github.com/bwoester/yii-event-interceptor)[ Packagist](https://packagist.org/packages/bwoester/yii-event-interceptor)[ Docs](https://github.com/bwoester/yii-event-interceptor)[ RSS](/packages/bwoester-yii-event-interceptor/feed)WikiDiscussions master Synced yesterday

READMEChangelog (2)DependenciesVersions (3)Used By (1)

yii-event-interceptor
=====================

[](#yii-event-interceptor)

The EventInterceptor is a CComponent which raises an onEventIntercepted event whenever the observed component raises an event. The onEventIntercepted event contains the name of the intercepted event, as well as the intercepted event itself.

It is mainly meant as a tool for other components and can be used like this:

```
// create interceptor
$eventInterceptor = new EventInterceptor();

// initialize it: pass the object that should be observed. By default, the
// EventInterceptor will attach itself to all events defined by $subject.
// If you only want to intercept some special events, use:
// $eventInterceptor->initialize( $subject, array('onFoo', 'onBar') );
$eventInterceptor->initialize( $subject );

// whenever the EventInterceptor intercepted an event of $subject, it will
// raise an onEventIntercepted event. Attach an event handler to this event
// that cares for processing. The event handler can be any valid php callback:
// $eventInterceptor->onEventIntercepted = 'handleInterceptedEvent_inGlobalFunction';
// $eventInterceptor->onEventIntercepted = array( 'Foo', 'handleInterceptedEvent_inStaticMethod' );
// $eventInterceptor->onEventIntercepted = array( $obj, 'handleInterceptedEvent_inMethod' );
$eventInterceptor->onEventIntercepted = function( InterceptionEvent $event ) {

  $sender = $event->sender; // will always be the EventInterceptor

  $originalEvent  = $event->getInterceptedEvent();
  $originalSender = $event->getInterceptedEvent()->sender;  // our $subject

  // also available:
  $originalEventName = $event->getInterceptedEventName();

};
```

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~438 days

Total

2

Last Release

4148d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/71cdf8e5559f6fed285a64e1b83c03d20f78dc8cf1970ff3f891b210c146d50a?d=identicon)[bwoester](/maintainers/bwoester)

---

Top Contributors

[![bwoester](https://avatars.githubusercontent.com/u/309565?v=4)](https://github.com/bwoester "bwoester (10 commits)")

---

Tags

eventyiicomponentintercept

### Embed Badge

![Health badge](/badges/bwoester-yii-event-interceptor/health.svg)

```
[![Health](https://phpackages.com/badges/bwoester-yii-event-interceptor/health.svg)](https://phpackages.com/packages/bwoester-yii-event-interceptor)
```

###  Alternatives

[doctrine/event-manager

The Doctrine Event Manager is a simple PHP event system that was built to be used with the various Doctrine projects.

6.1k501.1M115](/packages/doctrine-event-manager)[league/event

Event package

1.6k141.6M184](/packages/league-event)[laminas/laminas-eventmanager

Trigger and listen to events within a PHP application

1.0k69.8M225](/packages/laminas-laminas-eventmanager)[bwoester/yii-static-events-component

Attach events on class base.

1011.0k3](/packages/bwoester-yii-static-events-component)

PHPackages © 2026

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