Constants

VERBOSITY_QUIET

VERBOSITY_QUIET = 0

VERBOSITY_NORMAL

VERBOSITY_NORMAL = 1

VERBOSITY_VERBOSE

VERBOSITY_VERBOSE = 2

VERBOSITY_VERY_VERBOSE

VERBOSITY_VERY_VERBOSE = 3

VERBOSITY_DEBUG

VERBOSITY_DEBUG = 4

OUTPUT_NORMAL

OUTPUT_NORMAL = 0

OUTPUT_RAW

OUTPUT_RAW = 1

OUTPUT_PLAIN

OUTPUT_PLAIN = 2

Properties

$styles

$styles

$verbosity

$verbosity

$handle

$handle : \think\console\output\driver\Buffer|\think\console\output\driver\Console|\think\console\output\driver\Nothing

Type

Nothing

Methods

__construct()

__construct(mixed  $driver = 'console') : mixed

Parameters

mixed $driver

Returns

mixed —

ask()

ask(\think\console\Input  $input, mixed  $question, mixed  $default = null, mixed  $validator = null) : mixed

Parameters

\think\console\Input $input
mixed $question
mixed $default
mixed $validator

Returns

mixed —

askHidden()

askHidden(\think\console\Input  $input, mixed  $question, mixed  $validator = null) : mixed

Parameters

\think\console\Input $input
mixed $question
mixed $validator

Returns

mixed —

confirm()

confirm(\think\console\Input  $input, mixed  $question, mixed  $default = true) : mixed

Parameters

\think\console\Input $input
mixed $question
mixed $default

Returns

mixed —

choice()

choice(\think\console\Input  $input, mixed  $question, array  $choices, mixed  $default = null) : mixed

{@inheritdoc}

Parameters

\think\console\Input $input
mixed $question
array $choices
mixed $default

Returns

mixed —

newLine()

newLine(int  $count = 1) : void

输出空行

Parameters

int $count

writeln()

writeln(string  $messages, int  $type) : void

输出信息并换行

Parameters

string $messages
int $type

write()

write(string  $messages, bool  $newline = false, int  $type) : void

输出信息

Parameters

string $messages
bool $newline
int $type

renderException()

renderException(\Throwable  $e) : void

Parameters

\Throwable $e

setVerbosity()

setVerbosity(int  $level) : mixed

设置输出信息级别

Parameters

int $level

输出信息级别

Returns

mixed —

getVerbosity()

getVerbosity() : int

获取输出信息级别

Returns

int —

isQuiet()

isQuiet() : bool

Returns

bool —

isVerbose()

isVerbose() : bool

Returns

bool —

isVeryVerbose()

isVeryVerbose() : bool

Returns

bool —

isDebug()

isDebug() : bool

Returns

bool —

describe()

describe(mixed  $object, array  $options = []) : void

Parameters

mixed $object
array $options

__call()

__call(mixed  $method, mixed  $args) : mixed

Parameters

mixed $method
mixed $args

Returns

mixed —

setDecorated()

setDecorated(mixed  $decorated) : void

Parameters

mixed $decorated

fetch()

fetch() : string

Returns

string —

info()

info(mixed  $message) : void

Parameters

mixed $message

error()

error(mixed  $message) : void

Parameters

mixed $message

comment()

comment(mixed  $message) : void

Parameters

mixed $message

warning()

warning(mixed  $message) : void

Parameters

mixed $message

highlight()

highlight(mixed  $message) : void

Parameters

mixed $message

question()

question(mixed  $message) : void

Parameters

mixed $message

askQuestion()

askQuestion(\think\console\Input  $input, \think\console\output\Question  $question) : mixed

Parameters

\think\console\Input $input
\think\console\output\Question $question

Returns

mixed —

block()

block(string  $style, string  $message) : void

Parameters

string $style
string $message