Completed
Push — master ( 0c1255...399763 )
by Denis
01:54
created

ResultSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 40
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isSingleResult() 0 4 1
A getResults() 0 4 1
1
<?php
2
3
namespace PhpJsonRpc\Core;
4
5
use PhpJsonRpc\Core\Result\AbstractResult;
6
7
class ResultSpec
8
{
9
    /**
10
     * @var bool
11
     */
12
    private $singleResult = false;
13
14
    /**
15
     * @var AbstractResult[]
16
     */
17
    private $results;
18
19
    /**
20
     * ResultSpecifier constructor.
21
     *
22
     * @param AbstractResult[] $units
23
     * @param bool             $singleResult
24
     */
25
    public function __construct(array $units, bool $singleResult)
26
    {
27
        $this->results      = $units;
28
        $this->singleResult = $singleResult;
29
    }
30
31
    /**
32
     * @return boolean
33
     */
34
    public function isSingleResult()
35
    {
36
        return $this->singleResult;
37
    }
38
39
    /**
40
     * @return AbstractResult[]
41
     */
42
    public function getResults()
43
    {
44
        return $this->results;
45
    }
46
}
47