Passed
Push — sam-rework ( a7ef4a...16881f )
by Alexander
19:47 queued 04:49
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
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