Completed
Push — master ( 203e38...2cdd54 )
by Gerrit
13:04
created

CallDefinition::getRoutineName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
/**
3
 * Copyright (C) 2018 Gerrit Addiks.
4
 * This package (including this file) was released under the terms of the GPL-3.0.
5
 * You should have received a copy of the GNU General Public License along with this program.
6
 * If not, see <http://www.gnu.org/licenses/> or send me a mail so i can send you a copy.
7
 *
8
 * @license GPL-3.0
9
 *
10
 * @author Gerrit Addiks <[email protected]>
11
 */
12
13
namespace Addiks\RDMBundle\Mapping;
14
15
use Addiks\RDMBundle\Mapping\CallDefinitionInterface;
16
use Addiks\RDMBundle\Mapping\MappingInterface;
17
use Webmozart\Assert\Assert;
18
19
final class CallDefinition implements CallDefinitionInterface
20
{
21
22
    /**
23
     * @var string|null
24
     */
25
    private $objectReference;
26
27
    /**
28
     * @var string
29
     */
30
    private $routineName;
31
32
    /**
33
     * @var array<MappingInterface>
34
     */
35
    private $argumentMappings = array();
36
37 4
    public function __construct(
38
        string $routineName,
39
        string $objectReference = null,
40
        array $argumentMappings = array()
41
    ) {
42 4
        $this->routineName = $routineName;
43 4
        $this->objectReference = $objectReference;
44
45 4
        foreach ($argumentMappings as $argumentMapping) {
46
            /** @var MappingInterface $argumentMapping */
47
48 4
            Assert::isInstanceOf($argumentMapping, MappingInterface::class);
49
50 4
            $this->argumentMappings[] = $argumentMapping;
51
        }
52 4
    }
53
54 1
    public function getObjectReference(): ?string
55
    {
56 1
        return $this->objectReference;
57
    }
58
59 1
    public function getRoutineName(): string
60
    {
61 1
        return $this->routineName;
62
    }
63
64 1
    public function getArgumentMappings(): array
65
    {
66 1
        return $this->argumentMappings;
67
    }
68
69
}
70