Conditions | 3 |
Paths | 2 |
Total Lines | 16 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 3 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | 1 | public function getDependencyReference($definition, string $registrationName, string $type): string |
|
32 | { |
||
33 | 1 | if (!is_string($definition) || !Nette\Utils\Strings::startsWith($definition, '@')) { |
|
34 | 1 | $this->extension |
|
35 | 1 | ->getContainerBuilder() |
|
36 | 1 | ->addDefinition($registrationName = $this->extension->prefix($registrationName)) |
|
37 | 1 | ->setType($type) |
|
38 | 1 | ->setFactory($definition) |
|
39 | 1 | ->addTag(Nette\DI\Extensions\InjectExtension::TAG_INJECT); |
|
40 | |||
41 | 1 | $registrationName = '@' . $registrationName; |
|
42 | } else { |
||
43 | 1 | $registrationName = $definition; |
|
44 | } |
||
45 | |||
46 | 1 | return $registrationName; |
|
47 | } |
||
49 |