ObjectManager   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 19
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A create() 0 8 1
1
<?php
2
/**
3
 * Copyright © 2017 Toan Nguyen. All rights reserved.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 */
8
9
namespace Gojira\Framework\ObjectManager;
10
11
class ObjectManager implements ObjectManagerInterface
12
{
13
    /**
14
     * Create new object instance
15
     *
16
     * @param string $type
17
     * @param array  $arguments
18
     *
19
     * @return mixed
20
     */
21
    public static function create($type, array $arguments = [])
22
    {
23
        $type = ltrim($type, '\\');
24
        return call_user_func_array(
25
            [new \ReflectionClass($type), 'newInstance'],
26
            $arguments
27
        );
28
    }
29
}
30