Completed
Push — sam-rework ( a5f68e...28559d )
by Andrii
10:44
created

Factory   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 15
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A create() 0 5 1
A get() 0 3 1
1
<?php
2
/**
3
 * @link http://www.yiiframework.com/
4
 * @copyright Copyright (c) 2008 Yii Software LLC
5
 * @license http://www.yiiframework.com/license/
6
 */
7
8
namespace yii\di;
9
10
use yii\di\definitions\Normalizer;
11
use yii\di\exceptions\InvalidConfigException;
12
13
class Factory extends Container implements FactoryInterface
14
{
15
    /**
16
     * {@inheritdoc}
17
     */
18
    public function create($config, array $params = [])
19
    {
20
        $definition = Normalizer::normalize($config);
21
22
        return $definition->resolve($this, $params);
23
    }
24
25
    public function get($id)
26
    {
27
        return $this->build($this->getId($id));
28
    }
29
}
30