MethodCall::setArguments()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Palmtree\Container\Definition;
4
5
class MethodCall
6
{
7
    /** @var string */
8
    private $name;
9
    /** @var array */
10
    private $arguments = [];
11
12 23
    public static function fromYaml(array $yaml): self
13
    {
14 23
        $methodCall = new self();
15
16 23
        $methodCall->setName($yaml['method'])
17 23
                   ->setArguments($yaml['arguments'] ?? []);
18
19 23
        return $methodCall;
20
    }
21
22 24
    public function getName(): string
23
    {
24 24
        return $this->name;
25
    }
26
27 24
    public function setName(string $name): self
28
    {
29 24
        $this->name = $name;
30
31 24
        return $this;
32
    }
33
34 24
    public function getArguments(): array
35
    {
36 24
        return $this->arguments;
37
    }
38
39 24
    public function setArguments(array $arguments): self
40
    {
41 24
        $this->arguments = $arguments;
42
43 24
        return $this;
44
    }
45
}
46