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