Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 3.0175 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
27 | 4 | public function createByClassName(string $className): ?object |
|
28 | { |
||
29 | 4 | if (class_exists($className)) { |
|
30 | 4 | if (!isset($this->cachedDependencies[$className])) { |
|
31 | 4 | $this->cachedDependencies[$className] = $this |
|
32 | 4 | ->getDependencyResolver() |
|
33 | 4 | ->resolveDependencies($className); |
|
34 | } |
||
35 | |||
36 | /** @psalm-suppress MixedMethodCall */ |
||
37 | 4 | return new $className(...$this->cachedDependencies[$className]); |
|
38 | } |
||
39 | |||
40 | return null; |
||
41 | } |
||
54 |