AbstractFactory::get()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace WebComplete\core\factory;
4
5
use WebComplete\core\utils\container\ContainerInterface;
6
7
/**
8
 * Class AbstractFactory
9
 */
10
abstract class AbstractFactory
11
{
12
13
    /**
14
     * @var ContainerInterface
15
     */
16
    private $container;
17
18
    /**
19
     * @param ContainerInterface $container
20
     */
21
    public function __construct(ContainerInterface $container)
22
    {
23
        $this->container = $container;
24
    }
25
26
    /**
27
     * Get an instance
28
     *
29
     * @param $name
30
     * @return mixed
31
     */
32
    protected function get($name)
33
    {
34
        return $this->container->get($name);
35
    }
36
37
    /**
38
     * Create an instance
39
     *
40
     * @param $name
41
     * @return mixed
42
     */
43
    protected function make($name)
44
    {
45
        return $this->container->make($name);
46
    }
47
}
48