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

CalculationResponse   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 39
ccs 8
cts 8
cp 1
rs 10
wmc 4

4 Methods

Rating   Name   Duplication   Size   Complexity  
A getCalculations() 0 3 1
A __construct() 0 3 1
A setCalculations() 0 3 1
A getError() 0 3 1
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