mibadger/event

This package is abandoned and no longer maintained. No replacement package was suggested.

The Event Component

v3.0.0 2021-08-12 11:19 UTC

This package is auto-updated.

Last update: 2022-11-19 17:10:30 UTC


README

Build Status Code Coverage Scrutinizer Code Quality SensioLabsInsight

The Event Component.

Example(s)

<?php

use miBadger\Event\EventListenerInterface;

/**
 * The event listener class.
 */
class EventListener implements EventListenerInterface
{
	/**
	 * {@inheritdoc}
	 */
	public function update(SubjectInterface $subject, $arguments = null)
	{
		// Action that needs to be executed if the event fires.
	}
}
<?php

use miBadger\Event\Event;

/**
 * Construct a new event.
 */
$event = new Event();

/**
 * Construct a new event listener.
 */
$eventListener = new EventListener()

/**
 * Returns true if the observer is attached successfully.
 */
$event->attach($eventListener);

/**
 * Notify all the attached observers.
 */
$event->notify();