X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FOutput%2FNode%2FEventListener%2FFlow%2FFireOnlySiblingsListener.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FBehat%2FOutput%2FNode%2FEventListener%2FFlow%2FFireOnlySiblingsListener.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=7e578855449b71f8141bbb9579655e2bc5292145;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FireOnlySiblingsListener.php b/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FireOnlySiblingsListener.php deleted file mode 100644 index 7e5788554..000000000 --- a/vendor/behat/behat/src/Behat/Behat/Output/Node/EventListener/Flow/FireOnlySiblingsListener.php +++ /dev/null @@ -1,75 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Behat\Output\Node\EventListener\Flow; - -use Behat\Testwork\Output\Formatter; -use Behat\Testwork\Output\Node\EventListener\EventListener; -use Symfony\Component\EventDispatcher\Event; - -/** - * Behat fire only siblings listener. - * - * This listener catches all events, but proxies them to further listeners only if they - * live inside specific event lifecycle (between BEFORE and AFTER events). - * - * @author Konstantin Kudryashov - */ -class FireOnlySiblingsListener implements EventListener -{ - /** - * @var string - */ - private $beforeEventName; - /** - * @var string - */ - private $afterEventName; - /** - * @var EventListener - */ - private $descendant; - /** - * @var Boolean - */ - private $inContext = false; - - /** - * Initializes listener. - * - * @param string $beforeEventName - * @param string $afterEventName - * @param EventListener $descendant - */ - public function __construct($beforeEventName, $afterEventName, EventListener $descendant) - { - $this->beforeEventName = $beforeEventName; - $this->afterEventName = $afterEventName; - $this->descendant = $descendant; - } - - /** - * {@inheritdoc} - */ - public function listenEvent(Formatter $formatter, Event $event, $eventName) - { - if ($this->beforeEventName === $eventName) { - $this->inContext = true; - } - - if ($this->inContext) { - $this->descendant->listenEvent($formatter, $event, $eventName); - } - - if ($this->afterEventName === $eventName) { - $this->inContext = false; - } - } -}