| Conditions | 3 |
| Paths | 1 |
| Total Lines | 12 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 23 | public static function create(array $hydrate_templates) { |
||
| 24 | return new self(array_map(function($ht) { |
||
| 25 | if ($ht instanceof Plates\HydrateTemplate) { |
||
| 26 | return $ht; |
||
| 27 | } |
||
| 28 | if (is_callable($ht)) { |
||
| 29 | return new CallableHydrateTemplate($ht); |
||
| 30 | } |
||
| 31 | |||
| 32 | throw new Plates\Exception\HydrateTemplateException('Expected instance of HydrateTemplate, got ' . Plates\Util\debugType($ht)); |
||
| 33 | }, $hydrate_templates)); |
||
| 34 | } |
||
| 35 | } |
||
| 36 |