Prints outline header (if has not been printed yet) on example AFTER event.

@param Formatter $formatter
@param Event     $event
@param string    $eventName
557306
private function printHeaderOnAfterExampleEvent(Formatter $formatter, Event $event, $eventName)
    {
        if (!$event instanceof AfterScenarioTested || ExampleTested::AFTER !== $eventName) {
            return;
        }

        if ($this->headerPrinted) {
            return;
        }

        $feature = $event->getFeature();
        $stepTestResults = $this->getStepTestResults();

        $this->tablePrinter->printHeader($formatter, $feature, $this->outline, $stepTestResults);
        $this->headerPrinted = true;
    }
292716
public static function setPlaceholderFormatterDefinition(string $name, callable $callable): void
    {
        if (!self::$formatters) {
            self::$formatters = self::initPlaceholderFormatters();
        }

        self::$formatters[$name] = $callable;
    }
318770
public function fireEvent($eventName, Event $event = null)
    {
        /** @var EventDispatcher $events */
        $events = $this['events'];

        return $events->dispatch($eventName, $event);
    }
571664
public function addFormatter($field, $formatter, $options = null)
    {
        // support for field names as array
        if (is_array($field)) {
            foreach ($field as $f) {
                $this->setFormatter($f, $formatter, $options);
            }

            return $this;
        }

        if (!isset($this->columns[$field])) {
            throw new BaseException('Cannot format nonexistant field '.$field);
        }

        if ($formatter instanceof Closure) {
            $m_name = uniqid();
            $this->addMethod('format_'.$m_name, $formatter);
            $formatter = $m_name;
        }

        if ($this->columns[$field]['type']) {
            $this->columns[$field]['type'] .= ','.$formatter;
        } else {
            $this->columns[$field]['type'] = $formatter;
        }

        if ($options) {
            $this->columns[$field] = array_merge($this->columns[$field], $options);
        }
        $descr = $this->columns[$field];

        if (strpos($formatter, '\\') || strpos($formatter, '/')) {
            // add-on functionality:
            // http://agiletoolkit.org/codepad/gui/grid#codepad_gui_grid_view_example_7_ex
            if (!$this->elements[$formatter.'_'.$field]) {
                $addon = $this->app->normalizeClassName($formatter, 'Controller_Grid_Format');
                $this->elements[$formatter.'_'.$field] = $this->add($addon, $formatter);
            }

            $addon = $this->getElement($formatter.'_'.$field);
            if (!$addon instanceof Controller_Grid_Format) {
                throw $this->exception('Grid formatter class should extend Controller_Grid_Format class')
                    ->addMoreInfo('formater', $formatter);
            }
            $addon->initField($field, $descr);

            return $addon;
        } elseif ($this->hasMethod($m = 'init_'.$formatter)) {
            // execute formatter
            $this->$m($field, $descr);
        }

        return $this;
    }
968673
def WriteEvent(self, event):
    
    self.WriteEventStart()

    try:
      self.WriteEventBody(event)

    except errors.NoFormatterFound as exception:
      error_message = 'unable to retrieve formatter with error: {0!s}'.format(
          exception)
      self._ReportEventError(event, error_message)

    except errors.WrongFormatter as exception:
      error_message = 'wrong formatter with error: {0!s}'.format(exception)
      self._ReportEventError(event, error_message)

    self.WriteEventEnd()
584460
public static function create($formatter_name, array $params = [])
    {
        if (!self::isSupported($formatter_name)) {
            throw new Exception\InvalidArgumentException(__METHOD__ . " Formatter '$formatter_name' is not supported.");
        }
        $class = __NAMESPACE__ . '\\' . self::$formattersMap[strtolower($formatter_name)];

        return new $class($params);
    }
137392
public function onPreSetData(FormEvent $event)
    {
        $form = $event->getForm();
        $item = $event->getData();

        foreach ($this->fields as $field) {
            list ($name, $type, $options) = $field;
            if (null !== $item) {
                $options = array_replace($options, $this->itemHelper->getFormOptions($item, $name));
            }
            $form->add($name, $type, $options);
        }
    }
1335511
private function printStepOnAfterStepEvent(Formatter $formatter, Event $event)
    {
        if (!$event instanceof AfterStepTested) {
            return;
        }

        $this->stepPrinter->printStep($formatter, $this->example, $event->getStep(), $event->getTestResult());
        $this->stepSetupPrinter->printTeardown($formatter, $event->getTeardown());
    }
941526
public function addFormatter(SymbolFormatterInterface $formatter)
    {
        if ($formatter instanceof self) {
            // Reducing recursivity
            $this->addFormatters($formatter->formatters);
        } else {
            $this->formatters[] = $formatter;
        }

        return $this;
    }
1217349
public function onQuickFormEvent($event, $arg, &$caller) {
        if ($event === 'createElement') {
            if (!is_array($arg[2])) {
                $arg[2] = [];
            }
            $arg[2] += array('itemtype' => '', 'component' => '');
        }
        return parent::onQuickFormEvent($event, $arg, $caller);
    }
852356
public function setFormatter(Formatter $formatter)
    {
        $this->output->setFormatter($formatter);
        $this->errorOutput->setFormatter($formatter);
    }
1071579
private function printFooterOnAfterEvent(Formatter $formatter, ScenarioLikeTested $event, $eventName)
    {
        if ($this->afterEventName !== $eventName || !$event instanceof AfterTested) {
            return;
        }

        if ($this->setupPrinter) {
            $this->setupPrinter->printTeardown($formatter, $event->getTeardown());
        }

        $this->scenarioPrinter->printFooter($formatter, $event->getTestResult());
    }
719620
public function setFormatter(FormatterInterface $formatter, array $columns): self
    {
        $this->search()->in($columns)->setFormatter($formatter);

        return $this;
    }
484810
public function renderSectionHeader(string $sectionName) : void
    {
        if ($this->isSilent()) {
            return;
        }

        fwrite($this->file, '  ' . $this->formatter->formatPropertyName($sectionName) . ': ');
    }
27714
public function setFormatter(\Symfony\Component\Console\Formatter\OutputFormatterInterface $formatter)
    {
        $this->decoratedOutput->setFormatter($formatter);
    }
217162
protected function outputFormatTableEvent(array $events)
    {
        $header = array(
            $this->text('Text'),
            $this->text('Type'),
            $this->text('Severity'),
            $this->text('Created')
        );

        $rows = array();

        foreach ($events as $item) {
            $text = empty($item['translatable']) ? $item['text'] : $this->text($item['text']);
            $rows[] = array(
                $this->truncate($text, 50),
                $this->text($item['type']),
                $this->text($item['severity']),
                $this->date($item['created']),
            );
        }

        $this->outputFormatTable($rows, $header);
    }
694486
public function recordEvent($eventName, $payload)
    {
        if (! Telescope::isRecording() || $this->shouldIgnore($eventName)) {
            return;
        }

        $formattedPayload = $this->extractPayload($eventName, $payload);

        Telescope::recordEvent(IncomingEntry::make([
            'name' => $eventName,
            'payload' => empty($formattedPayload) ? null : $formattedPayload,
            'listeners' => $this->formatListeners($eventName),
            'broadcast' => class_exists($eventName)
                        ? in_array(ShouldBroadcast::class, (array) class_implements($eventName))
                        : false,
        ])->tags(class_exists($eventName) && isset($payload[0]) ? ExtractTags::from($payload[0]) : []));
    }