| Total Complexity | 12 |
| Total Lines | 58 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace FlatPlan\Components; |
||
| 3 | class Structure extends AbstractComponent { |
||
| 4 | |||
| 5 | private $role; |
||
| 6 | private $components; |
||
| 7 | |||
| 8 | protected $roles = ['aside', 'chapter', 'container', 'divider', 'header']; |
||
| 9 | |||
| 10 | /** |
||
| 11 | * @param string $role |
||
| 12 | * @return void |
||
| 13 | */ |
||
| 14 | public function __construct($role) |
||
| 17 | } |
||
| 18 | |||
| 19 | public function setRole($role) |
||
| 25 | } |
||
| 26 | |||
| 27 | public function getRole() |
||
| 28 | { |
||
| 29 | return $this->role; |
||
| 30 | } |
||
| 31 | |||
| 32 | public function setComponents($components) |
||
| 33 | { |
||
| 34 | if (is_array($components)) { |
||
| 35 | foreach ($components as $component) { |
||
| 36 | if ($component instanceof AbstractComponent) { |
||
| 37 | array_push($this->components, $component); |
||
| 38 | } |
||
| 39 | } |
||
| 40 | } else if ($components instanceof AbstractComponent) { |
||
| 41 | array_push($this->components, $components); |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | public function getComponents() |
||
| 46 | { |
||
| 47 | return $this->components; |
||
| 48 | } |
||
| 49 | |||
| 50 | public function getComponent() |
||
| 56 | } |
||
| 57 | |||
| 58 | public function __toString() |
||
| 61 | } |
||
| 62 | } |
||
| 63 |