ReflectionObjectFactory   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
c 0
b 0
f 0
lcom 0
cbo 0
dl 0
loc 33
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 2
A create() 0 4 1
A export() 0 4 1
A getReflector() 0 4 1
1
<?php
2
3
namespace DependencyInjection\Internal;
4
5
class ReflectionObjectFactory implements ReflectionFactoryInterface
6
{
7
    /**
8
     * @var \ReflectionObject
9
     */
10
    private $reflectionObject;
11
12
    public function __construct($object)
13
    {
14
        if (!is_object($object)) {
15
            throw Exception\ReflectionExceptionFactory::invalidArgument(
16
                sprintf("Parameter 1 of %s must be an object.", __METHOD__)
17
            );
18
        }
19
20
        $this->reflectionObject = new \ReflectionObject($object);
21
    }
22
23
    public static function create($object)
24
    {
25
        return new static($object);
26
    }
27
28
    public static function export($object, $return = false)
29
    {
30
        return \ReflectionObject::export($object, $return);
31
    }
32
33
    public function getReflector()
34
    {
35
        return $this->reflectionObject;
36
    }
37
}
38