Skip to content

Instantly share code, notes, and snippets.

@vatson
Created August 25, 2011 21:16
Show Gist options
  • Save vatson/1171992 to your computer and use it in GitHub Desktop.
Save vatson/1171992 to your computer and use it in GitHub Desktop.
chain prototype
<?php
$exceptionFilter = new ExceptionFilterHandler();
$exceptionFilter->allow('MyBundle\AbstractException')
->ignore('MyBundle\ConcreteException');
$errorFilter = new ErrorFilterHandler();
$errorFilter->allow(UniversalErrorCatcher_ErrorCode::E_CORE_ERROR)
->ignore(UniversalErrorCatcher_ErrorCode::E_ERROR);
$senderAdapter = new SwiftAdapter();
$senderClient = new Swift();
// OR
$senderAdapter = new JMSAdapter();
$senderClient = new Stomp();
$encoder = new HtmlEncoder();
$sender = new SenderHandler($senderAdapter, $senderClient, $encoder);
$exceptionFilter->nextDestination($errorFilter)->nextDestination($sender);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment