class Clear extends Command

Command that clears the cache.

Traits

Suggestion trait.
Controller helper trait.
Container aware trait.

Properties

protected Container $container Container. from ContainerAwareTrait
protected array $resolved Array of resolved objects and/or references to resolved objects. from ContainerAwareTrait
Application $app from ContainerAwareTrait
CacheManager $cache from ContainerAwareTrait
Input $input from ContainerAwareTrait
Output $output from ContainerAwareTrait
CommandBusInterface $bus from ContainerAwareTrait
Config $config from ContainerAwareTrait
ConnectionManager $database from ContainerAwareTrait
ErrorHandler $errorHandler from ContainerAwareTrait
Event $event from ContainerAwareTrait
FileSystem $fileSystem from ContainerAwareTrait
AuthorizerInterface $authorizer from ContainerAwareTrait
Gatekeeper $gatekeeper from ContainerAwareTrait
Request $request from ContainerAwareTrait
Response $response from ContainerAwareTrait
Routes $routes from ContainerAwareTrait
URLBuilder $urlBuilder from ContainerAwareTrait
I18n $i18n from ContainerAwareTrait
PaginationFactoryInterface $pagination from ContainerAwareTrait
ConnectionManager $redis from ContainerAwareTrait
CryptoManager $crypto from ContainerAwareTrait
Signer $signer from ContainerAwareTrait
Session $session from ContainerAwareTrait
Humanizer $humanizer from ContainerAwareTrait
ValidatorFactory $validator from ContainerAwareTrait
ViewFactory $view from ContainerAwareTrait
LoggerInterface $logger from ContainerAwareTrait
protected array $commandInformation Command information.
protected bool $isStrict Make the command strict.

Methods

setContainer(Container $container)

Sets the container instance.

mixed
__get(string $key)

Resolves item from the container using overloading.

nl(int $lines = 1, int $writer = Output::STANDARD)

Writes n newlines to output.

write(string $string, int $writer = Output::STANDARD)

Writes string to output.

error(string $string)

Writes string to output using the error writer.

clear()

Clears the screen.

alert(string $message, string $template = Alert::DEFAULT, int $writer = Output::STANDARD)

Draws an alert.

bell(int $times = 1)

Rings the terminal bell n times.

countdown(int $from = 5)

Counts down from n.

progressBar(int $items, int|null $redrawRate = null, string|null $prefix = null)

Draws a progress bar and returns a progress bar instance.

table(array $columnNames, array $rows, int $writer = Output::STANDARD)

Draws a table.

ol(array $items, string $marker = '<yellow>%s</yellow>.', int $writer = Output::STANDARD)

Draws an ordered list.

ul(array $items, string $marker = '<yellow>*</yellow>', int $writer = Output::STANDARD)

Draws an unordered list.

bool
confirm(string $question, string $default = 'n')

Writes question to output and returns boolesn value corresponding to the chosen value.

mixed
question(string $question, mixed $default = null)

Writes question to output and returns user input.

int
select(string $question, array $options)

Prints out a list of options and returns the array key of the chosen value.

mixed
secret(string $question, mixed $default = null, bool $fallback = false)

Writes question to output and returns hidden user input.

__construct(Input $input, Output $output, Config $config)

Constructor.

from Command
string
getCommandDescription()

Returns the command description.

from Command
array
getCommandArguments()

Returns the command arguments.

from Command
array
getCommandOptions()

Returns the command options.

from Command
bool
isStrict()

Returns TRUE we should be strict about what arguments and options we allow and FALSE if not.

from Command
string|null
suggest(string $string, array $alternatives)

Returns the string that resembles the provided string the most.

bool
checkConfigurationExistence(string $configuration)

Checks if the configuration exists.

from Command
int|void
execute(CacheManager $cache, string|null $configuration = null)

Executes the command.

Details

in ContainerAwareTrait at line 68
setContainer(Container $container)

Sets the container instance.

Parameters

Container $container Container

in ContainerAwareTrait at line 80
mixed __get(string $key)

Resolves item from the container using overloading.

Parameters

string $key Key

Return Value

mixed

Exceptions

RuntimeException

in CommandHelperTrait at line 41
protected nl(int $lines = 1, int $writer = Output::STANDARD)

Writes n newlines to output.

Parameters

int $lines Number of newlines to write
int $writer Output writer

in CommandHelperTrait at line 52
protected write(string $string, int $writer = Output::STANDARD)

Writes string to output.

Parameters

string $string String to write
int $writer Output writer

in CommandHelperTrait at line 62
protected error(string $string)

Writes string to output using the error writer.

Parameters

string $string String to write

in CommandHelperTrait at line 70
protected clear()

Clears the screen.

in CommandHelperTrait at line 82
protected alert(string $message, string $template = Alert::DEFAULT, int $writer = Output::STANDARD)

Draws an alert.

Parameters

string $message Message
string $template Alert template
int $writer Output writer

in CommandHelperTrait at line 92
protected bell(int $times = 1)

Rings the terminal bell n times.

Parameters

int $times Number of times to ring the bell

in CommandHelperTrait at line 102
protected countdown(int $from = 5)

Counts down from n.

Parameters

int $from Number of seconds to count down

in CommandHelperTrait at line 115
protected ProgressBar progressBar(int $items, int|null $redrawRate = null, string|null $prefix = null)

Draws a progress bar and returns a progress bar instance.

Parameters

int $items Total number of items
int|null $redrawRate Redraw rate
string|null $prefix Progress bar prefix

Return Value

ProgressBar

in CommandHelperTrait at line 142
protected table(array $columnNames, array $rows, int $writer = Output::STANDARD)

Draws a table.

Parameters

array $columnNames Array of column names
array $rows Array of rows
int $writer Output writer

in CommandHelperTrait at line 154
protected ol(array $items, string $marker = '<yellow>%s</yellow>.', int $writer = Output::STANDARD)

Draws an ordered list.

Parameters

array $items Items
string $marker Item marker
int $writer Output writer

in CommandHelperTrait at line 166
protected ul(array $items, string $marker = '<yellow>*</yellow>', int $writer = Output::STANDARD)

Draws an unordered list.

Parameters

array $items Items
string $marker Item marker
int $writer Output writer

in CommandHelperTrait at line 178
protected bool confirm(string $question, string $default = 'n')

Writes question to output and returns boolesn value corresponding to the chosen value.

Parameters

string $question Question to ask
string $default Default answer

Return Value

bool

in CommandHelperTrait at line 190
protected mixed question(string $question, mixed $default = null)

Writes question to output and returns user input.

Parameters

string $question Question to ask
mixed $default Default if no input is entered

Return Value

mixed

in CommandHelperTrait at line 202
protected int select(string $question, array $options)

Prints out a list of options and returns the array key of the chosen value.

Parameters

string $question Question to ask
array $options Numeric array of options to choose from

Return Value

int

in CommandHelperTrait at line 215
protected mixed secret(string $question, mixed $default = null, bool $fallback = false)

Writes question to output and returns hidden user input.

Parameters

string $question Question to ask
mixed $default Default if no input is entered
bool $fallback Fall back to non-hidden input?

Return Value

mixed

in Command at line 42
__construct(Input $input, Output $output, Config $config)

Constructor.

Parameters

Input $input Input
Output $output Output
Config $config Config

in Command at line 72
string getCommandDescription()

Returns the command description.

Return Value

string

in Command at line 80
array getCommandArguments()

Returns the command arguments.

Return Value

array

in Command at line 88
array getCommandOptions()

Returns the command options.

Return Value

array

in Command at line 96
bool isStrict()

Returns TRUE we should be strict about what arguments and options we allow and FALSE if not.

Return Value

bool

in SuggestionTrait at line 27
protected string|null suggest(string $string, array $alternatives)

Returns the string that resembles the provided string the most.

NULL is returned if no string with a similarity of 66% or more is found.

Parameters

string $string String
array $alternatives Alternatives

Return Value

string|null

in Command at line 55
protected bool checkConfigurationExistence(string $configuration)

Checks if the configuration exists.

Parameters

string $configuration Configuration name

Return Value

bool

at line 51
int|void execute(CacheManager $cache, string|null $configuration = null)

Executes the command.

Parameters

CacheManager $cache Cache manager
string|null $configuration Configuration name

Return Value

int|void