| @@ 64-71 (lines=8) @@ | ||
| 61 | ||
| 62 | // If there is no constructor, there is no |
|
| 63 | // dependencies, which means that our job is done. |
|
| 64 | if (! $constructor) { |
|
| 65 | $dependency = new $class; |
|
| 66 | if ($share === true) { |
|
| 67 | $this->dependencies[$class] = $dependency; |
|
| 68 | } |
|
| 69 | ||
| 70 | return $dependency; |
|
| 71 | } |
|
| 72 | ||
| 73 | // Fetch the arguments from the constructor |
|
| 74 | // (collection of ReflectionParameter instances) |
|
| @@ 79-85 (lines=7) @@ | ||
| 76 | ||
| 77 | // If there is a constructor, but no dependencies, |
|
| 78 | // our job is done. |
|
| 79 | if (count($params) === 0) { |
|
| 80 | $dependency = new $class; |
|
| 81 | if ($share === true) { |
|
| 82 | $this->dependencies[$class] = $dependency; |
|
| 83 | } |
|
| 84 | return $dependency; |
|
| 85 | } |
|
| 86 | ||
| 87 | // This is were we store the dependencies |
|
| 88 | $newInstanceParams = []; |
|