Binds icanboogie/event to ICanBoogie.

v3.0.0 2017-03-24 21:07 UTC

This package is auto-updated.

Last update: 2020-05-07 12:19:24 UTC


Release Build Status HHVM Code Quality Code Coverage Packagist

The icanboogie/bind-event package binds icanboogie/event to ICanBoogie, using its Autoconfig feature. It provides a config synthesizer for event hooks defined in event configuration fragments, and an events getter for Application instances.


namespace ICanBoogie;

require 'vendor/autoload.php';

$app = boot();

$app->configs['event']; // obtain the "event" config.
$app->events;           // obtain an EventCollection instance created with the "event" config.

Attaching event hooks using the event config

The event config can be used to define event hooks.

The following example demonstrates how an application can attach event hooks to be notified when nodes are saved (or nodes subclasses), and when an authentication exception is thrown during the dispatch of a request.


// config/event.php

namespace App;

use ICanBoogie;
use Icybee;

$hooks = Hooks::class . '::';

return [

	Icybee\Modules\Nodes\SaveOperation::class . '::process' => $hooks . 'on_nodes_save',
	ICanBoogie\HTTP\AuthenticationRequired::class . '::rescue' => $hooks . 'on_authentication_required_rescue'



The package requires PHP 5.6 or later.


The recommended way to install this package is through Composer:

$ composer require icanboogie/bind-event

Cloning the repository

The package is available on GitHub, its repository can be cloned with the following command line:

$ git clone https://github.com/ICanBoogie/bind-event.git


The package is documented as part of the ICanBoogie framework documentation. You can generate the documentation for the package and its dependencies with the make doc command. The documentation is generated in the build/docs directory. ApiGen is required. The directory can later be cleaned with the make clean command.


The test suite is ran with the make test command. PHPUnit and Composer need to be globally available to run the suite. The command installs dependencies as required. The make test-coverage command runs test suite and also creates an HTML coverage report in "build/coverage". The directory can later be cleaned with the make clean command.

The package is continuously tested by Travis CI.

Build Status Code Coverage


icanboogie/bind-event is licensed under the New BSD License - See the LICENSE file for details.