PHP Class Overtrue\PHPLint\Command\LintCommand

Inheritance: extends Symfony\Component\Console\Command\Command
Show file Open project: overtrue/phplint

Protected Properties

Property Type Description
$defaults array
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface

Public Methods

Method Description
initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) Initializes the command just after the input has been validated.

Protected Methods

Method Description
configure ( ) Configures the current command.
execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : null | integer Executes the current command.
executeLint ( Linter $linter, Symfony\Component\Console\Output\OutputInterface $output, integer $fileCount, boolean $cache = true ) Execute lint and return errors.
getConfigFile ( ) : string | null Get configuration file.
getScreenColumns ( ) : integer Get screen columns.
loadConfiguration ( string $path ) : array Load configuration from yaml.
mergeOptions ( ) : array Merge options.
showErrors ( array $errors ) Show errors detail.

Method Details

configure() protected method

Configures the current command.
protected configure ( )

execute() protected method

This method is not abstract because you can use this class as a concrete class. In this case, instead of defining the execute() method, you set the code to execute by passing a Closure to the setCode() method.
See also: setCode()
protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output ) : null | integer
$input Symfony\Component\Console\Input\InputInterface An InputInterface instance
$output Symfony\Component\Console\Output\OutputInterface An OutputInterface instance
return null | integer null or 0 if everything went fine, or an error code

executeLint() protected method

Execute lint and return errors.
protected executeLint ( Linter $linter, Symfony\Component\Console\Output\OutputInterface $output, integer $fileCount, boolean $cache = true )
$linter Overtrue\PHPLint\Linter
$output Symfony\Component\Console\Output\OutputInterface
$fileCount integer
$cache boolean

getConfigFile() protected method

Get configuration file.
protected getConfigFile ( ) : string | null
return string | null

getScreenColumns() protected method

Get screen columns.
protected getScreenColumns ( ) : integer
return integer

initialize() public method

This is mainly useful when a lot of commands extends one main command where some things need to be initialized based on the input arguments and options.
public initialize ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface An InputInterface instance
$output Symfony\Component\Console\Output\OutputInterface An OutputInterface instance

loadConfiguration() protected method

Load configuration from yaml.
protected loadConfiguration ( string $path ) : array
$path string
return array

mergeOptions() protected method

Merge options.
protected mergeOptions ( ) : array
return array

showErrors() protected method

Show errors detail.
protected showErrors ( array $errors )
$errors array

Property Details

$defaults protected property

protected array $defaults
return array

$input protected property

protected InputInterface,Symfony\Component\Console\Input $input
return Symfony\Component\Console\Input\InputInterface

$output protected property

protected OutputInterface,Symfony\Component\Console\Output $output
return Symfony\Component\Console\Output\OutputInterface