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

Factory::get()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 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