Service::getName()   A
last analyzed

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 2
Bugs 0 Features 2
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 2
b 0
f 2
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of the LaravelYaml package.
5
 *
6
 * (c) Théo FIDRY <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Fidry\LaravelYaml\DependencyInjection\Definition;
13
14
/**
15
 * @author Théo FIDRY <[email protected]>
16
 */
17
final class Service implements ServiceInterface
18
{
19
    /**
20
     * @var string
21
     */
22
    private $name;
23
24
    /**
25
     * @var string
26
     */
27
    private $class;
28
29
    /**
30
     * @var string[]|Reference[]
31
     */
32
    private $arguments;
33
34
    /**
35
     * @var string[]
36
     */
37
    private $autowiringTypes;
38
39
    /**
40
     * @var array
41
     */
42
    private $tags;
43
44
    /**
45
     * @param string               $name            Name of the service
46
     * @param string               $class           FQCN of the service
47
     * @param string[]|Reference[] $arguments       List of arguments passed for the service instantiation
48
     * @param array|null           $autowiringTypes List of autowired classes
49
     * @param array|null           $tags
50
     */
51 4
    public function __construct($name, $class, array $arguments = [], array $autowiringTypes = [], array $tags = [])
52
    {
53 4
        $this->name = $name;
54 4
        $this->class = $class;
55 4
        $this->arguments = $arguments;
56 4
        $this->autowiringTypes = $autowiringTypes;
57 4
        $this->tags = $tags;
58 4
    }
59
60
    /**
61
     * {@inheritdoc}
62
     */
63 4
    public function getName()
64
    {
65 4
        return $this->name;
66
    }
67
68
    /**
69
     * {@inheritdoc}
70
     */
71 4
    public function getClass()
72
    {
73 4
        return $this->class;
74
    }
75
76
    /**
77
     * {@inheritdoc}
78
     */
79 4
    public function getArguments()
80
    {
81 4
        return $this->arguments;
82
    }
83
84
    /**
85
     * {@inheritdoc}
86
     */
87 4
    public function getAutowiringTypes()
88
    {
89 4
        return $this->autowiringTypes;
90
    }
91
92
    /**
93
     * {@inheritdoc}
94
     */
95 4
    public function getTags()
96
    {
97 4
        return $this->tags;
98
    }
99
}
100