1 | <?php |
||
0 ignored issues
–
show
Coding Style
introduced
by
![]() |
|||
2 | namespace EddIriarte\Console\Helpers; |
||
0 ignored issues
–
show
|
|||
3 | |||
4 | use Symfony\Component\Console\Input\StreamableInputInterface; |
||
5 | |||
6 | /** |
||
7 | * Trait OptionChunks |
||
8 | * @package EddIriarte\Console\Helpers |
||
0 ignored issues
–
show
|
|||
9 | * @author Eduardo Iriarte <eddiriarte[at]gmail[dot]com> |
||
0 ignored issues
–
show
Content of the @author tag must be in the form "Display Name <[email protected]>"
![]() |
|||
10 | */ |
||
0 ignored issues
–
show
|
|||
11 | trait StreamableInput |
||
12 | { |
||
0 ignored issues
–
show
|
|||
13 | /** |
||
0 ignored issues
–
show
|
|||
14 | * @var resource |
||
15 | */ |
||
16 | protected $inputStream; |
||
0 ignored issues
–
show
|
|||
17 | |||
18 | /** |
||
0 ignored issues
–
show
|
|||
19 | * @return bool|resource |
||
0 ignored issues
–
show
|
|||
20 | */ |
||
21 | 1 | protected function getInputStream() |
|
0 ignored issues
–
show
|
|||
22 | { |
||
0 ignored issues
–
show
|
|||
23 | 1 | if (empty($this->inputStream) && $this->input instanceof StreamableInputInterface) { |
|
0 ignored issues
–
show
|
|||
24 | 1 | $this->inputStream = $this->input->getStream() ?: STDIN; |
|
0 ignored issues
–
show
|
|||
25 | } |
||
26 | |||
27 | 1 | return $this->inputStream; |
|
28 | } |
||
0 ignored issues
–
show
|
|||
29 | } |
||
0 ignored issues
–
show
|
|||
30 |