Code Duplication    Length = 7-8 lines in 2 locations

Zewa/DIContainer.php 2 locations

@@ 56-63 (lines=8) @@
53
54
        // If there is no constructor, there is no
55
        // dependencies, which means that our job is done.
56
        if (! $constructor) {
57
            $dependency = new $class;
58
            if ($share === true) {
59
                $this->dependencies[$class] = $dependency;
60
            }
61
62
            return $dependency;
63
        }
64
65
        // Fetch the arguments from the constructor
66
        // (collection of ReflectionParameter instances)
@@ 71-77 (lines=7) @@
68
69
        // If there is a constructor, but no dependencies,
70
        // our job is done.
71
        if (count($params) === 0) {
72
            $dependency = new $class;
73
            if ($share === true) {
74
                $this->dependencies[$class] = $dependency;
75
            }
76
            return $dependency;
77
        }
78
79
        // This is were we store the dependencies
80
        $newInstanceParams = [];