| Conditions | 1 |
| Paths | 1 |
| Total Lines | 16 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | * @param array $attributesKeyValue |
||
| 22 | * @return AttributeInterface[] |
||
| 23 | */ |
||
| 24 | 304 | public static function createFromArray(array $attributesKeyValue): array |
|
| 25 | { |
||
| 26 | 304 | $attributes = []; |
|
| 27 | |||
| 28 | /** @var Closure|scalar|null $value */ |
||
| 29 | 304 | foreach ($attributesKeyValue as $name => $value) { |
|
| 30 | 304 | if (is_int($name) && is_string($value)) { |
|
| 31 | 34 | $attributes[] = self::create($value); |
|
| 32 | 34 | continue; |
|
| 33 | } |
||
| 34 | 301 | Assert::string($name); |
|
| 35 | 301 | $attributes[] = self::create($name, $value); |
|
| 36 | } |
||
| 37 | 303 | return $attributes; |
|
| 56 |