| Conditions | 4 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 4.0312 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | 92 | public static function normalize($definition, string $id = null): DefinitionInterface |
|
| 24 | { |
||
| 25 | 92 | if (is_array($definition) && isset($definition[DefinitionParser::IS_PREPARED_ARRAY_DEFINITION_DATA])) { |
|
| 26 | 32 | [$class, $constructorArguments, $methodsAndProperties] = $definition; |
|
| 27 | |||
| 28 | 32 | $class = $class ?? $id; |
|
| 29 | 32 | if ($class === null) { |
|
| 30 | throw new InvalidConfigException('Invalid definition: don\'t set class name.'); |
||
| 31 | } |
||
| 32 | |||
| 33 | 32 | return ArrayDefinition::fromPreparedData($class, $constructorArguments, $methodsAndProperties); |
|
| 34 | } |
||
| 35 | |||
| 36 | 92 | return Normalizer::normalize($definition, $id); |
|
| 37 | } |
||
| 39 |