| Total Complexity | 7 |
| Total Lines | 44 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | class SubThemeUnserializer implements ThemeUnserializerInterface |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var BlockUnserializer |
||
| 15 | */ |
||
| 16 | private $blockUnserializer; |
||
| 17 | /** |
||
| 18 | * @var AggregateThemeUnserializer |
||
| 19 | */ |
||
| 20 | private $aggregateThemeUnserializer; |
||
| 21 | |||
| 22 | public function __construct(BlockUnserializer $blockUnserializer, AggregateThemeUnserializer $aggregateThemeUnserializer) |
||
| 27 | } |
||
| 28 | |||
| 29 | public function createFromArray(array $arr): ThemeDescriptorInterface |
||
| 30 | { |
||
| 31 | $additionalContext = $arr['additionalContext']; |
||
| 32 | foreach ($additionalContext as $key => &$value) { |
||
| 33 | $value = $this->unserializeContextArray($value); |
||
| 34 | } |
||
| 35 | |||
| 36 | return new SubThemeDescriptor($this->aggregateThemeUnserializer->createFromArray($arr['theme']), $additionalContext); |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param mixed $value |
||
| 41 | * @return mixed |
||
| 42 | */ |
||
| 43 | private function unserializeContextArray($value) |
||
| 55 | } |
||
| 56 | } |
||
| 57 |