Prints scenario/background header on BEFORE event.

@param Formatter                     $formatter
@param ScenarioLikeTested|AfterSetup $event
@param string                        $eventName
322002
private function printHeaderOnBeforeEvent(Formatter $formatter, ScenarioLikeTested $event, $eventName)
    {
        if ($this->beforeEventName !== $eventName || !$event instanceof AfterSetup) {
            return;
        }

        if ($this->setupPrinter) {
            $this->setupPrinter->printSetup($formatter, $event->getSetup());
        }

        $this->scenarioPrinter->printHeader($formatter, $event->getFeature(), $event->getScenario());
    }
1352632
public function onLayoutBoxFormInit(FormEvent $event)
    {
        $builder       = $event->getFormBuilder();
        $form          = $event->getForm();
        $configurators = $this->container->get('layout_box.configurator.collection')->all();
        $resource      = $event->getResource();
        $boxSettings   = $resource->getSettings();
        
        foreach ($configurators as $configurator) {
            if ($configurator instanceof LayoutBoxConfiguratorInterface) {
                $defaults = [];
                if ($resource->getBoxType() == $configurator->getType()) {
                    $defaults = $boxSettings;
                }
                
                $configurator->addFormFields($builder, $form, $defaults);
            }
        }
    }
1080037
public function beforeRender(Event $event)
    {
        if ($this->_controller()->getName() === 'Error') {
            return;
        }

        if (!empty($event->getSubject()->entity)) {
            $this->_entity = $event->getSubject()->entity;
        }

        if ($this->associations === null) {
            $this->associations = $this->_associations(array_keys($this->_getRelatedModels()));
        }

        $this->ensureConfig();

        $this->beforeRenderFormType();
        $this->beforeRenderIndexType();
        $this->beforeRenderSiteTitle();
        $this->beforeRenderUtilityNavigation();
        $this->beforeRenderSidebarNavigation();

        $controller = $this->_controller();
        $controller->set('actionConfig', $this->_action()->getConfig());
        $controller->set('title', $this->_getPageTitle());
        $controller->set('breadcrumbs', $this->_getBreadcrumbs());

        $associations = $this->associations;
        $controller->set(compact('associations'));

        $fields = $this->_scaffoldFields($associations);
        $controller->set('fields', $fields);
        $controller->set('formTabGroups', $this->_getFormTabGroups($fields));

        $controller->set('blacklist', $this->_blacklist());
        $controller->set('actions', $this->_getControllerActions());
        $controller->set('bulkActions', $this->_getBulkActions());
        $controller->set('viewblocks', $this->_getViewBlocks());
        $controller->set('actionGroups', $this->_getActionGroups());
        $controller->set($this->_getPageVariables());
    }
821024
private function printStatisticsOnAfterExerciseEvent(Formatter $formatter, $eventName)
    {
        if (ExerciseCompleted::AFTER !== $eventName) {
            return;
        }

        $this->statistics->stopTimer();
        $this->printer->printStatistics($formatter, $this->statistics);
    }
1101497
public function getFormatter($formatter=null) {
		if (!$formatter) {
			$formatter = $this->getActualEditorType();
		}

		if (!isset(self::$registered_formatters[$formatter])) {
			throw new Exception("Formatter $formatter does not exist");
		}

		return self::$registered_formatters[$formatter];
	}
1067220
public function onCreateConnection(HostEvent $event)
    {
        $connectionAdapter = $this->getConnectionAdapter($event->getHost());
        if ($connectionAdapter instanceof ConnectionAdapterInterface) {
            $event->getHost()->setConnection($connectionAdapter);
        }
    }
144837
private function initEventDispatcher(
        OutputInterface $output,
        string $formatterName,
        bool $verbose
    ): EventDispatcherInterface {
        if ('dot' === $formatterName) {
            $formatter = new DotFormatter($output);
        } elseif ('pretty' === $formatterName) {
            $formatter = new PrettyFormatter($output, $verbose);
        } elseif ('simple' === $formatterName) {
            $formatter = new SimpleFormatter();
        } else {
            throw new \RuntimeException(
                sprintf('Format "%s" is unknown. Available formats: %s.', $formatterName, implode(', ', $this->formats))
            );
        }

        $eventDispatcher = new EventDispatcher();
        $eventDispatcher->addSubscriber($formatter);

        return $eventDispatcher;
    }
336589
private function captureOutlineOnBeforeOutlineEvent(Event $event)
    {
        if (!$event instanceof BeforeOutlineTested) {
            return;
        }

        $this->outline = $event->getOutline();
        $this->headerPrinted = false;
    }
224503
public function preSetData(FormEvent $event)
    {
        /** @var SessionConfigurationInterface $configuration */
        $configuration = $event->getData();

        if (empty($configuration) || empty($configuration) && $event->getForm()->has('answers')) {
            return;
        }

        $this->addAnswersFields($event->getForm());
        $this->addFlag($event);
    }
451632
public function printFeatureOnAfterEvent(Formatter $formatter, Event $event)
    {
        if (!$event instanceof AfterFeatureTested) {
            return;
        }

        $this->featurePrinter->printHeader($formatter, $this->beforeFeatureTestedEvent);

        foreach ($this->afterScenarioTestedEvents as $afterScenario) {
            $afterScenarioTested = $afterScenario['event'];
            $this->scenarioPrinter->printOpenTag($formatter, $afterScenarioTested->getFeature(), $afterScenarioTested->getScenario(), $afterScenarioTested->getTestResult());

            /** @var AfterStepSetup $afterStepSetup */
            foreach ($afterScenario['step_setup_events'] as $afterStepSetup) {
                $this->setupPrinter->printSetup($formatter, $afterStepSetup->getSetup());
            }
            foreach ($afterScenario['step_events'] as $afterStepTested) {
                $this->stepPrinter->printStep($formatter, $afterScenarioTested->getScenario(), $afterStepTested->getStep(), $afterStepTested->getTestResult());
                $this->setupPrinter->printTeardown($formatter, $afterStepTested->getTeardown());
            }
        }

        $this->featurePrinter->printFooter($formatter, $event->getTestResult());
        $this->afterScenarioTestedEvents = array();
    }
1126005
protected function assertHasStepForEvent($eventName)
    {
        if (!isset($this->eventBindings[$eventName])) {
            throw new NoStepForEventFoundException(
                sprintf('No step handling event %s in scenario %s.', $eventName, get_class($this->scenario))
            );
        }
    }
872928
private void setupFormat(final ConditionNumberFormatter formatter) {

        if(formatter.containsSymbolTerm(Token.SYMBOL_SLASH)) {
            // 分数として処理する
            setupFormatAsFraction(formatter);
        } else {
            // 数値として処理する
            setupFormatAsDecimal(formatter);
        }

    }
830628
public function onPreSendHAHeaders(HttpClientPreSendRequestEvent $event)
    {
        if ($event->getRequest()->getQueryMode() == 'WRITE') {
            $event->getRequest()->setHeader($this->queryModeHeaderName, $this->queryModeWriteQueryHeaderValue);
        } elseif ($event->getRequest()->getQueryMode() == 'READ') {
            $event->getRequest()->setHeader($this->queryModeHeaderName, $this->queryModeReadQueryHeaderValue);
        }
    }
852356
public function setFormatter(Formatter $formatter)
    {
        $this->output->setFormatter($formatter);
        $this->errorOutput->setFormatter($formatter);
    }
550350
public function beforeConvert(ConvertEvent $convertEvent): void
    {
        if ($convertEvent->isHandledBy(SculpinMarkdownBundle::CONVERTER_NAME, SculpinTwigBundle::FORMATTER_NAME)) {
            $content = $convertEvent->source()->content();
            foreach (self::$addPlaceholderRe as $re) {
                $content = preg_replace($re, self::$placeholder, $content);
            }
            $content = preg_replace(
                '/{%\s+(\w+)\s+(\w+\++\w+)\s+%}(.*){%\s+end\1\s+%}/Us',
                '<div data-$1="$2">$3</div>',
                $content
            );
            $convertEvent->source()->setContent($content);
        }
    }
228708
protected function bindPatterns($eventName)
    {
        if (isset($this->syncedEvents[$eventName])) {
            return;
        }

        foreach ($this->patterns as $eventPattern => $patterns) {
            foreach ($patterns as $pattern) {
                if ($pattern->test($eventName)) {
                    $pattern->bind($this->dispatcher, $eventName);
                }
            }
        }

        $this->syncedEvents[$eventName] = true;
    }
691845
public function afterScenario(ScenarioEvent $event)
    {
        $scenario = $event->getScenario();
        $feature = $scenario->getFeature();
        $url = $feature->getFile();
        $issue = $this->jiraService->getIssue($url);

        if ($issue) {
            $this->postComment($issue, $event->getResult(), $scenario->getTitle());
            $this->updateIssue($issue, $event->getResult());
        }
    }