PHPackages                             worksolutions/yii-ws-event-dispatcher - 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. worksolutions/yii-ws-event-dispatcher

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

worksolutions/yii-ws-event-dispatcher
=====================================

Yii event dispatcher

319[1 issues](https://github.com/worksolutions/yii-ws-event-dispatcher/issues)PHP

Since Jun 5Pushed 12y ago5 watchersCompare

[ Source](https://github.com/worksolutions/yii-ws-event-dispatcher)[ Packagist](https://packagist.org/packages/worksolutions/yii-ws-event-dispatcher)[ RSS](/packages/worksolutions-yii-ws-event-dispatcher/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii-ws-event-dispatcher
=======================

[](#yii-ws-event-dispatcher)

[![Travis CI](https://camo.githubusercontent.com/7a88f2168d294c3076c1ef33297a76542cb9caabb714376d51fbeb6ba2cd1ff3/68747470733a2f2f7472617669732d63692e6f72672f776f726b736f6c7574696f6e732f7969692d77732d6576656e742d646973706174636865722e706e67 "Travis CI")](https://travis-ci.org/worksolutions/yii-ws-event-dispatcher)[![Coverage Status](https://camo.githubusercontent.com/8f0536f79a4a976b5a0fc7c6639f7e718b82058d1c36b76fda57bee13923fe7d/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f776f726b736f6c7574696f6e732f7969692d77732d6576656e742d646973706174636865722f62616467652e706e673f6272616e63683d6d6173746572)](https://coveralls.io/r/worksolutions/yii-ws-event-dispatcher?branch=master)

EventDispatcher component a simple and effective make your projects truly extensible.

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

[](#installation)

Add a dependency to your project's composer.json:

```
{
    "require": {
        "worksolutions/yii-ws-event-dispatcher": "dev-master"
    }
}
```

Usage examples
--------------

[](#usage-examples)

#### Event call

[](#event-call)

```
$dispatcher = Yii::app()->eventDispatcher;

/** @var SomeEvent $event */
$event = $dispatcher->createEvent(SomeEvent::className(), $eventTestParams);
$dispatcher->fire($event);
```

#### Config EventDispatcher component

[](#config-eventdispatcher-component)

```
'components' => array(
    'eventDispatcher' => array(
        'class' => \WS\EventDispatcher\EventDispatcher::className(),
        'events' => array(
            SomeEvent::className() => array(
                array(
                     'class' => SomeHandler::className(),
                     'params' => array(),
                ),
                //...
            ),
            //...
        ),
    ),
    //...
)
```

#### Create handler class

[](#create-handler-class)

```
use WS\EventDispatcher\Handler;

class SomeHandler extends Handler {
    protected function identity() {
        // check the availability of execution
        return true;
    }

    protected function process() {
        // you handler code
    }
}
```

#### Create event class

[](#create-event-class)

```
use WS\EventDispatcher\Event;

class SomeEvent extends Event {
    public function attributeNames() {
        return array(
            'fieldName',
            //...
        );
    }

    public function rules() {
        return array(
            //validation rules
        );
    }
}
```

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![petrgrishin](https://avatars.githubusercontent.com/u/580229?v=4)](https://github.com/petrgrishin "petrgrishin (23 commits)")[![elfelrandcor](https://avatars.githubusercontent.com/u/1535876?v=4)](https://github.com/elfelrandcor "elfelrandcor (13 commits)")

### Embed Badge

![Health badge](/badges/worksolutions-yii-ws-event-dispatcher/health.svg)

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

###  Alternatives

[secondtruth/phar-compiler

Generic PHP PHAR compiler

263.3k5](/packages/secondtruth-phar-compiler)

PHPackages © 2026

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