當前位置: 首頁>>代碼示例>>PHP>>正文


PHP OutputInterface::newLine方法代碼示例

本文整理匯總了PHP中Symfony\Component\Console\Output\OutputInterface::newLine方法的典型用法代碼示例。如果您正苦於以下問題:PHP OutputInterface::newLine方法的具體用法?PHP OutputInterface::newLine怎麽用?PHP OutputInterface::newLine使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\Console\Output\OutputInterface的用法示例。


在下文中一共展示了OutputInterface::newLine方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: writeError

 /**
  * {@inheritdoc}
  */
 protected function writeError(OutputInterface $output, \Exception $error)
 {
     if ($output instanceof SymfonyStyle) {
         $output->newLine();
         $output->error($error->getMessage());
         return;
     }
     parent::writeError($output, $error);
 }
開發者ID:xingshanghe,項目名稱:symfony,代碼行數:12,代碼來源:SymfonyQuestionHelper.php

示例2: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $name = $input->getArgument('name');
     if (empty($name)) {
         $output->comment('Provide the name of a bundle as the first argument of this command to dump its configuration.');
         $output->newLine();
         $this->listBundles($output);
         return;
     }
     $extension = $this->findExtension($name);
     $container = $this->compileContainer();
     $configs = $container->getExtensionConfig($extension->getAlias());
     $configuration = $extension->getConfiguration($configs, $container);
     $this->validateConfiguration($extension, $configuration);
     $configs = $container->getParameterBag()->resolveValue($configs);
     $processor = new Processor();
     $config = $processor->processConfiguration($configuration, $configs);
     if ($name === $extension->getAlias()) {
         $output->title(sprintf('Current configuration for extension with alias "%s"', $name));
     } else {
         $output->title(sprintf('Current configuration for "%s"', $name));
     }
     $output->writeln(Yaml::dump(array($extension->getAlias() => $config), 3));
 }
開發者ID:0mars,項目名稱:symfony,代碼行數:27,代碼來源:ConfigDebugCommand.php

示例3: outputExecutionInfo

 /**
  * Output execution status information to the console
  *
  * @param OutputInterface|StyleInterface $output
  * @param ConsoleTask $task
  * @param int $number The number of the task to be executed
  * @param int $total The total amount of tasks to be executed
  */
 protected function outputExecutionInfo($output, ConsoleTask $task, $number, $total)
 {
     $taskXofY = "Task ({$number}/{$total})";
     // Special formatting, if Symfony Style is provided
     if ($output instanceof StyleInterface) {
         $output->section($task->getName());
         $output->text($task->getDescription());
         $output->text($taskXofY);
         $output->newLine();
         return;
     }
     // Std. formatting
     $output->writeln($task->getName());
     $output->writeln('--------------------------------');
     $output->writeln($task->getDescription());
     $output->writeln($taskXofY);
     $output->writeln('');
 }
開發者ID:aedart,項目名稱:scaffold,代碼行數:26,代碼來源:TaskRunner.php


注:本文中的Symfony\Component\Console\Output\OutputInterface::newLine方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。