| Total Complexity | 5 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace FlatPlan\Components; |
||
| 5 | class Gallery extends AbstractComponent { |
||
| 6 | |||
| 7 | protected $items = array(); |
||
| 8 | |||
| 9 | protected $roles = ['gallery', 'mosaic']; |
||
| 10 | |||
| 11 | /** |
||
| 12 | * @param string $role |
||
| 13 | * @param string $bannerType |
||
| 14 | * @return void |
||
| 15 | */ |
||
| 16 | public function __construct($role) |
||
| 17 | { |
||
| 18 | $this->setRole($role); |
||
| 19 | } |
||
| 20 | |||
| 21 | public function setItem($item) |
||
| 22 | { |
||
| 23 | if ($item instanceof Image) { |
||
| 24 | array_push($this->items, $item); |
||
| 25 | } else { |
||
| 26 | throw new \ErrorException('Invalid image component supplied.'); |
||
| 27 | } |
||
| 28 | } |
||
| 29 | |||
| 30 | private function getItems() |
||
| 31 | { |
||
| 32 | return $this->items; |
||
| 33 | } |
||
| 34 | |||
| 35 | protected function getComponent() |
||
| 41 | } |
||
| 42 | } |
||
| 43 |