X-Git-Url: https://yaffs.net/gitweb/?a=blobdiff_plain;f=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FOutput%2FNodeEventListeningFormatter.php;fp=vendor%2Fbehat%2Fbehat%2Fsrc%2FBehat%2FTestwork%2FOutput%2FNodeEventListeningFormatter.php;h=0000000000000000000000000000000000000000;hb=af6d1fb995500ae68849458ee10d66abbdcfb252;hp=3894d49fa320bf5a725de6d3a39b797224d05646;hpb=680c79a86e3ed402f263faeac92e89fb6d9edcc0;p=yaffs-website diff --git a/vendor/behat/behat/src/Behat/Testwork/Output/NodeEventListeningFormatter.php b/vendor/behat/behat/src/Behat/Testwork/Output/NodeEventListeningFormatter.php deleted file mode 100644 index 3894d49fa..000000000 --- a/vendor/behat/behat/src/Behat/Testwork/Output/NodeEventListeningFormatter.php +++ /dev/null @@ -1,126 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Behat\Testwork\Output; - -use Behat\Testwork\EventDispatcher\TestworkEventDispatcher; -use Behat\Testwork\Output\Node\EventListener\EventListener; -use Behat\Testwork\Output\Printer\OutputPrinter; -use Symfony\Component\EventDispatcher\Event; - -/** - * Formatter built around the idea of event delegation and composition. - * - * @author Konstantin Kudryashov - */ -final class NodeEventListeningFormatter implements Formatter -{ - /** - * @var OutputPrinter - */ - private $printer; - /** - * @var array - */ - private $parameters; - /** - * @var EventListener - */ - private $listener; - /** - * @var string - */ - private $name; - /** - * @var string - */ - private $description; - - /** - * Initializes formatter. - * - * @param string $name - * @param string $description - * @param array $parameters - * @param OutputPrinter $printer - * @param EventListener $listener - */ - public function __construct($name, $description, array $parameters, OutputPrinter $printer, EventListener $listener) - { - $this->name = $name; - $this->description = $description; - $this->parameters = $parameters; - $this->printer = $printer; - $this->listener = $listener; - } - - /** - * Returns an array of event names this subscriber wants to listen to. - * - * @return array The event names to listen to - */ - public static function getSubscribedEvents() - { - return array(TestworkEventDispatcher::BEFORE_ALL_EVENTS => 'listenEvent'); - } - - /** - * Proxies event to the listener. - * - * @param Event $event - * @param null|string $eventName - */ - public function listenEvent(Event $event, $eventName = null) - { - $eventName = $eventName ?: $event->getName(); - - $this->listener->listenEvent($this, $event, $eventName); - } - - /** - * {@inheritdoc} - */ - public function getName() - { - return $this->name; - } - - /** - * {@inheritdoc} - */ - public function getDescription() - { - return $this->description; - } - - /** - * {@inheritdoc} - */ - public function getOutputPrinter() - { - return $this->printer; - } - - /** - * {@inheritdoc} - */ - public function setParameter($name, $value) - { - $this->parameters[$name] = $value; - } - - /** - * {@inheritdoc} - */ - public function getParameter($name) - { - return isset($this->parameters[$name]) ? $this->parameters[$name] : null; - } -}