Passed
Push — main ( 8bdffa...c425e9 )
by Vasil
04:29
created

CalculationResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace VasilDakov\Speedy\Service\Calculation;
6
7
use Doctrine\Common\Collections\ArrayCollection;
8
use VasilDakov\Speedy\Error;
9
use JMS\Serializer\Annotation as Serializer;
10
11
/**
12
 * Class CalculationResponse
13
 *
14
 * @author Vasil Dakov <[email protected]>
15
 * @copyright 2009-2022 Neutrino.bg
16
 * @version 1.0
17
 */
18
class CalculationResponse
19
{
20
    /**
21
     * @Serializer\Type("ArrayCollection<VasilDakov\Speedy\Model\CalculationResult>")
22
     */
23
    private ArrayCollection $calculations;
24
25
    /**
26
     * @var Error|null
27
     */
28
    private ?Error $error = null;
29
30 2
    public function __construct()
31
    {
32 2
        $this->calculations = new ArrayCollection();
33
    }
34
35
    /**
36
     * @param ArrayCollection $calculations
37
     */
38 1
    public function setCalculations(ArrayCollection $calculations): void
39
    {
40 1
        $this->calculations = $calculations;
41
    }
42
43
    /**
44
     * @return ArrayCollection
45
     */
46 1
    public function getCalculations(): ArrayCollection
47
    {
48 1
        return $this->calculations;
49
    }
50
51
    /**
52
     * @return Error|null
53
     */
54 1
    public function getError(): ?Error
55
    {
56 1
        return $this->error;
57
    }
58
}
59