| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 4 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | 84 | public static function normalize($definition, string $id): DefinitionInterface |
|
| 27 | { |
||
| 28 | 84 | if (is_array($definition) && isset($definition[DefinitionParser::IS_PREPARED_ARRAY_DEFINITION_DATA])) { |
|
| 29 | /** @psalm-suppress MixedArgument Definition should be valid {@see Container::$validate} */ |
||
| 30 | 38 | return ArrayDefinition::fromPreparedData( |
|
| 31 | 38 | $definition['class'] ?? $id, |
|
| 32 | 38 | $definition['__construct()'], |
|
| 33 | 38 | $definition['methodsAndProperties'] |
|
| 34 | ); |
||
| 35 | } |
||
| 36 | |||
| 37 | 84 | if ($definition instanceof ExtensibleService) { |
|
| 38 | 5 | return $definition; |
|
| 39 | } |
||
| 40 | |||
| 41 | 84 | return Normalizer::normalize($definition, $id); |
|
| 42 | } |
||
| 44 |