labelValue() public method

Formats a pair label-value.
public labelValue ( string $label, mixed $value )
$label string
$value mixed
示例#1
0
 /**
  * Writes the result of a parsing a site.
  *
  * @param \Yosymfony\Spress\IO\ConsoleIO                    $io
  * @param \Yosymfony\Spress\Core\DataSource\ItemInterface[] $items
  */
 protected function resultMessage(ConsoleIO $io, array $items)
 {
     $io->newLine();
     $io->labelValue('Total items', count($items));
     $io->newLine();
     $io->success('Success!');
 }
示例#2
0
 public function testLabelValue()
 {
     $this->command->setCode(function (InputInterface $input, OutputInterface $output) use(&$isDecorated) {
         $io = new ConsoleIO($input, $output);
         $io->labelValue('Items', 20);
     });
     $this->tester->execute([], ['interactive' => false, 'decorated' => false]);
     $this->assertEquals("Items: 20\n", $this->tester->getDisplay(true));
 }