Test Failed
Push — main ( 80b66f...88de3c )
by Vasil
03:26
created

CalculationResponse::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 0
cts 0
cp 0
crap 2
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
    public function __construct()
31
    {
32
        $this->calculations = new ArrayCollection();
33
    }
34
35
    /**
36
     * @param ArrayCollection $calculations
37
     */
38
    public function setCalculations(ArrayCollection $calculations): void
39
    {
40
        $this->calculations = $calculations;
41
    }
42
43
    /**
44
     * @return ArrayCollection
45
     */
46
    public function getCalculations(): ArrayCollection
47
    {
48
        return $this->calculations;
49
    }
50
51
    /**
52
     * @return Error|null
53
     */
54
    public function getError(): ?Error
55
    {
56
        return $this->error;
57
    }
58
}
59