Passed
Push — sam-rework ( a7ef4a...16881f )
by Alexander
19:47 queued 04:49
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 2
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
12
class Factory extends Container implements FactoryInterface
13
{
14
    /**
15
     * {@inheritdoc}
16
     */
17
    public function create($config, array $params = [])
18
    {
19
        $definition = Normalizer::normalize($config);
20
21
        return $definition->resolve($this, $params);
22
    }
23
24
    public function get($id, array $params = [])
25
    {
26
        return $this->build($this->getId($id), $params);
27
    }
28
}
29