| Conditions | 3 |
| Paths | 1 |
| Total Lines | 11 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function createFromArray(array $arr): ThemeDescriptorInterface |
||
| 31 | { |
||
| 32 | if (!isset($arr['type'])) { |
||
| 33 | throw new CMSException('Missing type key in theme.'); |
||
| 34 | } |
||
| 35 | $type = $arr['type']; |
||
| 36 | if (!isset($this->unserializers[$type])) { |
||
| 37 | throw new CMSException('Unknown theme type: '.$type); |
||
| 38 | } |
||
| 39 | |||
| 40 | return $this->unserializers[$type]->createFromArray($arr); |
||
| 41 | } |
||
| 42 | } |