Completed
Push — master ( b31906...e560b1 )
by Théo
13:58
created

Factory::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 5
rs 9.4285
cc 1
eloc 3
nc 1
nop 3
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 Factory implements FactoryInterface
18
{
19
    /**
20
     * @var ServiceInterface
21
     */
22
    private $service;
23
24
    /**
25
     * @var array<Reference|string, string>
26
     */
27
    private $factory;
28
29
    /**
30
     * @param ServiceInterface $service
31
     * @param string|Reference $factory
32
     * @param string           $factoryMethod
33
     */
34
    public function __construct(ServiceInterface $service, $factory, $factoryMethod)
35
    {
36
        $this->service = $service;
37
        $this->factory = [$factory, $factoryMethod];
38
    }
39
40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getName()
44
    {
45
        return $this->service->getName();
46
    }
47
48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function getClass()
52
    {
53
        return $this->service->getClass();
54
    }
55
56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function getArguments()
60
    {
61
        return $this->service->getArguments();
62
    }
63
64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function getAutowiringTypes()
68
    {
69
        return $this->service->getAutowiringTypes();
70
    }
71
72
    /**
73
     * {@inheritdoc}
74
     */
75
    public function getTags()
76
    {
77
        return $this->service->getTags();
78
    }
79
80
    /**
81
     * {@inheritdoc}
82
     */
83
    public function getFactory()
84
    {
85
        return $this->factory;
86
    }
87
}
88