Namshi\Notificator\Manager::addHandler PHP Method

addHandler() public method

Adds an handler to this manager.
public addHandler ( Namshi\Notificator\Notification\Handler\HandlerInterface $handler )
$handler Namshi\Notificator\Notification\Handler\HandlerInterface
    public function addHandler(HandlerInterface $handler)
    {
        $this->handlers[] = $handler;
    }

Usage Example

Example #1
0
 function notify($event)
 {
     $result = $event->getResult();
     $failed = $result->failureCount() or $result->errorCount();
     $manager = new Manager();
     $manager->addHandler(new NotifySendHandler());
     $notification = new NotifySendNotification("Codeception Tests " . ($failed ? "FAILED" : "PASSED"));
     $manager->trigger($notification);
 }
All Usage Examples Of Namshi\Notificator\Manager::addHandler