original_string: public function connectOutputToLogging(OutputInterface $output, $command)
      {
          static $alreadyConnected = false;
          $helper = $this;
  
          // ignore any second or later invocations of this method
          if ($alreadyConnected) {
              return;
          }
  
          /** @var Dispatcher $eventDispatcher  */
          $eventDispatcher = $command->getService('event_dispatcher');
  
          $eventDispatcher->addListener(
              'parser.file.pre',
              function (PreFileEvent $event) use ($output) {
                  $output->writeln('Parsing <info>'.$event->getFile().'</info>');
              }
          );
  
          $eventDispatcher->addListener(
              'system.log',
              function (LogEvent $event) use ($command, $helper, $output) {
                  $helper->logEvent($output, $event, $command);
              }
          );
  
          $alreadyConnected = true;
      }
code: public function connectOutputToLogging(OutputInterface $output, $command)
      {
          static $alreadyConnected = false;
          $helper = $this;
  
          // ignore any second or later invocations of this method
          if ($alreadyConnected) {
              return;
          }
  
          /** @var Dispatcher $eventDispatcher  */
          $eventDispatcher = $command->getService('event_dispatcher');
  
          $eventDispatcher->addListener(
              'parser.file.pre',
              function (PreFileEvent $event) use ($output) {
                  $output->writeln('Parsing <info>'.$event->getFile().'</info>');
              }
          );
  
          $eventDispatcher->addListener(
              'system.log',
              function (LogEvent $event) use ($command, $helper, $output) {
                  $helper->logEvent($output, $event, $command);
              }
          );
  
          $alreadyConnected = true;
      }
code_tokens: public function connectOutputToLogging ( OutputInterface $ output , $ command ) { static $ alreadyConnected = false ; $ helper = $ this ; // ignore any second or later invocations of this method if ( $ alreadyConnected ) { return ; } /** @var Dispatcher $eventDispatcher  */ $ eventDispatcher = $ command -> getService ( 'event_dispatcher' ) ; $ eventDispatcher -> addListener ( 'parser.file.pre' , function ( PreFileEvent $ event ) use ( $ output ) { $ output -> writeln ( 'Parsing <info>' . $ event -> getFile ( ) . '</info>' ) ; } ) ; $ eventDispatcher -> addListener ( 'system.log' , function ( LogEvent $ event ) use ( $ command , $ helper , $ output ) { $ helper -> logEvent ( $ output , $ event , $ command ) ; } ) ; $ alreadyConnected = true ; }
docstring: Connect the logging events to the output object of Symfony Console.
  
  @param OutputInterface $output
  @param Command $command
  
  @return void
docstring_tokens: Connect the logging events to the output object of Symfony Console .