The Event Component
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
docs
src
tests
.gitattributes
.gitignore
.scrutinizer.yml
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml.dist

README.md

Event

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();