You are here

private function SymfonyStyle::autoPrependBlock in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/console/Style/SymfonyStyle.php \Symfony\Component\Console\Style\SymfonyStyle::autoPrependBlock()
4 calls to SymfonyStyle::autoPrependBlock()
SymfonyStyle::askQuestion in vendor/symfony/console/Style/SymfonyStyle.php
SymfonyStyle::block in vendor/symfony/console/Style/SymfonyStyle.php
Formats a message as a block of text.
SymfonyStyle::section in vendor/symfony/console/Style/SymfonyStyle.php
Formats a section title.
SymfonyStyle::title in vendor/symfony/console/Style/SymfonyStyle.php
Formats a command title.

File

vendor/symfony/console/Style/SymfonyStyle.php, line 378

Class

SymfonyStyle
Output decorator helpers for the Symfony Style Guide.

Namespace

Symfony\Component\Console\Style

Code

private function autoPrependBlock() {
  $chars = substr(str_replace(PHP_EOL, "\n", $this->bufferedOutput
    ->fetch()), -2);
  if (!isset($chars[0])) {
    return $this
      ->newLine();

    //empty history, so we should start with a new line.
  }

  //Prepend new line for each non LF chars (This means no blank line was output before)
  $this
    ->newLine(2 - substr_count($chars, "\n"));
}