Overview

Namespaces

  • Evenement
  • None
  • Peridot
    • Console
    • Core
    • Reporter
    • Runner
    • Scope
    • Test
  • Symfony
    • Component
      • Console
        • Command
        • Descriptor
        • Event
        • Exception
        • Formatter
        • Helper
        • Input
        • Logger
        • Output
        • Question
        • Style
        • Tester
        • Tests
          • Command
          • Descriptor
          • Fixtures
          • Formatter
          • Helper
          • Input
          • Logger
          • Output
          • Style
          • Tester

Classes

  • OutputStyle
  • SymfonyStyle

Interfaces

  • StyleInterface
  • Overview
  • Namespace
  • Class

Class SymfonyStyle

Output decorator helpers for the Symfony Style Guide.

Symfony\Component\Console\Style\OutputStyle implements Symfony\Component\Console\Output\OutputInterface, Symfony\Component\Console\Style\StyleInterface
Extended by Symfony\Component\Console\Style\SymfonyStyle

Direct known subclasses

Symfony\Component\Console\Tests\Style\SymfonyStyleWithForcedLineLength
Namespace: Symfony\Component\Console\Style
Author: Kevin Bond kevinbond@gmail.com
Located at Style/SymfonyStyle.php
Methods summary
public
# __construct( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )

Parameters

$input
$output

Overrides

Symfony\Component\Console\Style\OutputStyle::__construct()
public
# block( string|array $messages, string|null $type = null, string|null $style = null, string $prefix = ' ', boolean $padding = false )

Formats a message as a block of text.

Formats a message as a block of text.

Parameters

$messages
The message to write in the block
$type
The block type (added in [] on first line)
$style
The style to apply to the whole block
$prefix
The prefix for the block
$padding
Whether to add vertical padding
public
# title( string $message )

Formats a command title.

Formats a command title.

Parameters

$message
public
# section( string $message )

Formats a section title.

Formats a section title.

Parameters

$message
public
# listing( array $elements )

Formats a list.

Formats a list.

Parameters

$elements
public
# text( string|array $message )

Formats informational text.

Formats informational text.

Parameters

$message
public
# comment( string|array $message )

Formats a command comment.

Formats a command comment.

Parameters

$message
public
# success( string|array $message )

Formats a success result bar.

Formats a success result bar.

Parameters

$message
public
# error( string|array $message )

Formats an error result bar.

Formats an error result bar.

Parameters

$message
public
# warning( string|array $message )

Formats an warning result bar.

Formats an warning result bar.

Parameters

$message
public
# note( string|array $message )

Formats a note admonition.

Formats a note admonition.

Parameters

$message
public
# caution( string|array $message )

Formats a caution admonition.

Formats a caution admonition.

Parameters

$message
public
# table( array $headers, array $rows )

Formats a table.

Formats a table.

Parameters

$headers
$rows
public string
# ask( string $question, string|null $default = null, callable|null $validator = null )

Asks a question.

Asks a question.

Parameters

$question
$default
$validator

Returns

string
public string
# askHidden( string $question, callable|null $validator = null )

Asks a question with the user input hidden.

Asks a question with the user input hidden.

Parameters

$question
$validator

Returns

string
public boolean
# confirm( string $question, boolean $default = true )

Asks for confirmation.

Asks for confirmation.

Parameters

$question
$default

Returns

boolean
public string
# choice( string $question, array $choices, string|integer|null $default = null )

Asks a choice question.

Asks a choice question.

Parameters

$question
$choices
$default

Returns

string
public
# progressStart( integer $max = 0 )

Starts the progress output.

Starts the progress output.

Parameters

$max
Maximum steps (0 if unknown)
public
# progressAdvance( integer $step = 1 )

Advances the progress output X steps.

Advances the progress output X steps.

Parameters

$step
Number of steps to advance
public
# progressFinish( )

Finishes the progress output.

Finishes the progress output.

public Symfony\Component\Console\Helper\ProgressBar
# createProgressBar( integer $max = 0 )

Parameters

$max

Returns

Symfony\Component\Console\Helper\ProgressBar

Overrides

Symfony\Component\Console\Style\OutputStyle::createProgressBar()
public string
# askQuestion( Symfony\Component\Console\Question\Question $question )

Parameters

$question

Returns

string
public
# writeln( string|array $messages, integer $type = self::OUTPUT_NORMAL )

Writes a message to the output and adds a newline at the end.

Writes a message to the output and adds a newline at the end.

Parameters

$messages
The message as an array of lines of a single string
$type
$options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL

Overrides

Symfony\Component\Console\Style\OutputStyle::writeln()
public
# write( string|array $messages, boolean $newline = false, integer $type = self::OUTPUT_NORMAL )

Writes a message to the output.

Writes a message to the output.

Parameters

$messages
The message as an array of lines or a single string
$newline
Whether to add a newline
$type
$options A bitmask of options (one of the OUTPUT or VERBOSITY constants), 0 is considered the same as self::OUTPUT_NORMAL | self::VERBOSITY_NORMAL

Overrides

Symfony\Component\Console\Style\OutputStyle::write()
public
# newLine( integer $count = 1 )

Add newline(s).

Add newline(s).

Parameters

$count
The number of newlines

Overrides

Symfony\Component\Console\Style\OutputStyle::newLine()
Methods inherited from Symfony\Component\Console\Style\OutputStyle
getFormatter(), getVerbosity(), isDecorated(), setDecorated(), setFormatter(), setVerbosity()
Constants summary
integer MAX_LINE_LENGTH
# 120
Constants inherited from Symfony\Component\Console\Output\OutputInterface
OUTPUT_NORMAL, OUTPUT_PLAIN, OUTPUT_RAW, VERBOSITY_DEBUG, VERBOSITY_NORMAL, VERBOSITY_QUIET, VERBOSITY_VERBOSE, VERBOSITY_VERY_VERBOSE
Peridot API documentation generated by ApiGen