| Conditions | 4 |
| Paths | 3 |
| Total Lines | 20 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 38 | 3 | protected function buildDefinitionFromCallable(string $callable = NULL) |
|
| 39 | { |
||
| 40 | 3 | if ($callable === NULL) { |
|
| 41 | 2 | return NULL; |
|
| 42 | } |
||
| 43 | |||
| 44 | 2 | $builder = $this->getContainerBuilder(); |
|
| 45 | 2 | $definition = $builder->addDefinition($this->prefix(md5($callable))); |
|
| 46 | |||
| 47 | 2 | list($definition->factory) = Compiler::filterArguments([ |
|
|
|
|||
| 48 | 2 | is_string($callable) ? new Statement($callable) : $callable |
|
| 49 | ]); |
||
| 50 | |||
| 51 | 2 | list($resolverClass) = (array) $builder->normalizeEntity($definition->getFactory()->getEntity()); |
|
| 52 | 2 | if (class_exists($resolverClass)) { |
|
| 53 | 2 | $definition->setClass($resolverClass); |
|
| 54 | } |
||
| 55 | |||
| 56 | 2 | return $definition; |
|
| 57 | } |
||
| 58 | |||
| 60 |
This method has been deprecated.