Completed
Push — master ( 106c7e...3c0ece )
by Dzmitry
06:55
created

ExecutionResult::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 1
Bugs 1 Features 0
Metric Value
c 1
b 1
f 0
dl 0
loc 5
ccs 4
cts 4
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 2
crap 1
1
<?php
2
namespace ivol;
3
4
class ExecutionResult
5
{
6
    /** @var array */
7
    private $output;
8
    /** @var int */
9
    private $returnCode;
10
11
    /**
12
     * @param int $returnCode
13
     * @param string $output
14
     */
15 5
    public function __construct($returnCode, $output)
16
    {
17 5
        $this->returnCode = $returnCode;
18 5
        $this->output = $output;
0 ignored issues
show
Documentation Bug introduced by
It seems like $output of type string is incompatible with the declared type array of property $output.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
19 5
    }
20
21
    /**
22
     * @return string
23
     */
24 3
    public function getOutput()
25
    {
26 3
        return $this->output ? implode('\n', $this->output): '';
27
    }
28
29
    /**
30
     * @return int
31
     */
32 3
    public function getReturnCode()
33
    {
34 3
        return $this->returnCode;
35
    }
36
37
}