for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace EddIriarte\Console\Inputs;
use EddIriarte\Console\Inputs\Traits\ChunkableOptions;
use EddIriarte\Console\Inputs\Interfaces\SelectInput;
/**
* Class AbstractSelect
* @package EddIriarte\Console\Inputs
* @author Eduardo Iriarte <eddiriarte[at]gmail[dot]com>
*/
abstract class AbstractSelect implements SelectInput
{
use ChunkableOptions;
protected $message;
protected $options;
protected $selections;
* AbstractSelect constructor.
*
* @param string $message
* @param array $options
public function __construct(string $message, array $options)
$this->message = $message;
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
$a = "a"; $ab = "ab"; $abc = "abc";
will produce issues in the first and second line, while this second example
will produce no issues.
$this->options = $options;
$this->selections = [];
}
* {@inheritdoc}
public function getMessage(): string
return $this->message;
* @return array
public function getOptions(): array
return $this->options;
public function getSelections(): array
return $this->selections;
* @return bool
public function hasSelections(): bool
return !empty($this->selections);
* @param string $option
public function isSelected(string $option): bool
return (bool) in_array($option, $this->selections);
cast
This check marks files that end in a newline character, i.e. an empy line.