eddiriarte /
console-select
| 1 | <?php |
||||||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||||||
| 2 | namespace EddIriarte\Console\Traits; |
||||||
|
0 ignored issues
–
show
|
|||||||
| 3 | |||||||
| 4 | use EddIriarte\Console\Helpers\SelectionHelper; |
||||||
| 5 | use EddIriarte\Console\Inputs\CheckboxInput; |
||||||
| 6 | use EddIriarte\Console\Inputs\RadioInput; |
||||||
| 7 | use Symfony\Component\Console\Input\InputInterface; |
||||||
| 8 | use Symfony\Component\Console\Output\OutputInterface; |
||||||
| 9 | |||||||
| 10 | trait SelectableInputs |
||||||
|
0 ignored issues
–
show
|
|||||||
| 11 | { |
||||||
|
0 ignored issues
–
show
|
|||||||
| 12 | 1 | public function enableSelectHelper(InputInterface $input, OutputInterface $output) |
|||||
|
0 ignored issues
–
show
|
|||||||
| 13 | { |
||||||
|
0 ignored issues
–
show
|
|||||||
| 14 | 1 | $this->getHelperSet()->set( |
|||||
|
0 ignored issues
–
show
It seems like
getHelperSet() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||||
| 15 | 1 | new SelectionHelper($input, $output) |
|||||
| 16 | ); |
||||||
| 17 | 1 | } |
|||||
|
0 ignored issues
–
show
|
|||||||
| 18 | |||||||
| 19 | 2 | public function select(string $message, array $options, bool $allowMultiple = true) |
|||||
|
0 ignored issues
–
show
|
|||||||
| 20 | { |
||||||
|
0 ignored issues
–
show
|
|||||||
| 21 | 2 | $helper = $this->getHelper('selection'); |
|||||
|
0 ignored issues
–
show
It seems like
getHelper() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space
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 $a = "a";
$ab = "ab";
$abc = "abc";
will produce no issues. Loading history...
|
|||||||
| 22 | 2 | $question = $allowMultiple ? new CheckboxInput($message, $options) : new RadioInput($message, $options); |
|||||
|
0 ignored issues
–
show
|
|||||||
| 23 | |||||||
| 24 | 2 | return $helper->select($question); |
|||||
| 25 | } |
||||||
|
0 ignored issues
–
show
|
|||||||
| 26 | } |
||||||
|
0 ignored issues
–
show
|
|||||||
| 27 |