src/Console/Command/DetectCommand.php
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;
    }
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;
    }
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 ; }
Init the event dispatcher by attaching the output formatters.
Init the event dispatcher by attaching the output formatters .