X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FEventDispatcher%2FTestworkEventDispatcher.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FEventDispatcher%2FTestworkEventDispatcher.php;h=0000000000000000000000000000000000000000;hp=c1200f300915ef8d7e75f2b32378b6a0292813bf;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0 diff --git a/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php b/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php deleted file mode 100644 index c1200f300..000000000 --- a/vendor/behat/behat/src/Behat/Testwork/EventDispatcher/TestworkEventDispatcher.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Testwork\EventDispatcher; - -use Symfony\Component\EventDispatcher\Event; -use Symfony\Component\EventDispatcher\EventDispatcher; - -/** - * Extends Symfony2 event dispatcher with catch-all listeners. - * - * @author Konstantin Kudryashov - */ -final class TestworkEventDispatcher extends EventDispatcher -{ - const BEFORE_ALL_EVENTS = '*~'; - const AFTER_ALL_EVENTS = '~*'; - - /** - * {@inheritdoc} - */ - public function dispatch($eventName, Event $event = null) - { - if (null === $event) { - $event = new Event(); - } - - if (method_exists($event, 'setName')) { - $event->setName($eventName); - } - - $this->doDispatch($this->getListeners($eventName), $eventName, $event); - - return $event; - } - - /** - * {@inheritdoc} - */ - public function getListeners($eventName = null) - { - if (null == $eventName || self::BEFORE_ALL_EVENTS === $eventName) { - return parent::getListeners($eventName); - } - - return array_merge( - parent::getListeners(self::BEFORE_ALL_EVENTS), - parent::getListeners($eventName), - parent::getListeners(self::AFTER_ALL_EVENTS) - ); - } -}