/** * Renders the name and version. * * @param IO $io The I/O. * @param int $indentation The number of spaces to indent. */ public function render(IO $io, $indentation = 0) { if ($this->config->getDisplayName() && $this->config->getVersion()) { $paragraph = new Paragraph("{$this->config->getDisplayName()} version <c1>{$this->config->getVersion()}</c1>"); } elseif ($this->config->getDisplayName()) { $paragraph = new Paragraph("{$this->config->getDisplayName()}"); } else { $paragraph = new Paragraph('Console Tool'); } $paragraph->render($io, $indentation); }
public function testSkipIndentationForEmptyLines() { $para = new Paragraph(self::LOREM_IPSUM . "\n\n" . self::LOREM_IPSUM); $para->render($this->io, 6); $expected = <<<'EOF' Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt EOF; $this->assertSame($expected, $this->io->fetchOutput()); }