StreamableInput::getInputStream()   A
last analyzed

Complexity

Conditions 4
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 4

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 7
ccs 4
cts 4
cp 1
rs 10
c 0
b 0
f 0
cc 4
nc 2
nop 0
crap 4
1
<?php
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Filename "StreamableInput.php" doesn't match the expected filename "streamableinput.php"
Loading history...
2
namespace EddIriarte\Console\Helpers;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
use Symfony\Component\Console\Input\StreamableInputInterface;
5
6
/**
7
 * Trait OptionChunks
8
 * @package EddIriarte\Console\Helpers
0 ignored issues
show
Coding Style introduced by
There must be exactly one blank line before the tags in a doc comment
Loading history...
9
 * @author Eduardo Iriarte <eddiriarte[at]gmail[dot]com>
0 ignored issues
show
Coding Style introduced by
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
10
 */
0 ignored issues
show
Coding Style introduced by
Missing @category tag in class comment
Loading history...
Coding Style introduced by
Missing @license tag in class comment
Loading history...
Coding Style introduced by
Missing @link tag in class comment
Loading history...
11
trait StreamableInput
12
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for trait StreamableInput
Loading history...
13
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
14
     * @var resource
15
     */
16
    protected $inputStream;
0 ignored issues
show
Coding Style introduced by
Protected member variable "inputStream" must contain a leading underscore
Loading history...
Coding Style introduced by
Expected 1 blank line before member var; 0 found
Loading history...
17
18
    /**
0 ignored issues
show
Coding Style introduced by
Missing short description in doc comment
Loading history...
19
     * @return bool|resource
0 ignored issues
show
Coding Style introduced by
Expected "boolean|resource" but found "bool|resource" for function return type
Loading history...
20
     */
21 1
    protected function getInputStream()
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 1 found
Loading history...
22
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
23 1
        if (empty($this->inputStream) && $this->input instanceof StreamableInputInterface) {
0 ignored issues
show
Bug introduced by
The property input does not exist on EddIriarte\Console\Helpers\StreamableInput. Did you mean inputStream?
Loading history...
24 1
            $this->inputStream = $this->input->getStream() ?: STDIN;
0 ignored issues
show
Coding Style introduced by
The value of a comparison must not be assigned to a variable
Loading history...
Coding Style introduced by
Inline IF statements are not allowed
Loading history...
25
        }
26
27 1
        return $this->inputStream;
28
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end getInputStream()
Loading history...
29
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
30