| Total Complexity | 9 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace FlatPlan\Components; |
||
| 3 | abstract class AbstractComponent { |
||
| 4 | |||
| 5 | protected $role; |
||
| 6 | protected $layout = 'layout'; |
||
| 7 | protected $style = 'style'; |
||
| 8 | protected $textStyle = 'textStyle'; |
||
| 9 | |||
| 10 | abstract public function getComponent(); |
||
| 11 | |||
| 12 | public function setRole($role) |
||
| 19 | } |
||
| 20 | |||
| 21 | public function getRole() |
||
| 24 | } |
||
| 25 | |||
| 26 | public function setIdentifier($identifier) |
||
| 27 | { |
||
| 28 | $this->identifier = $identifier; |
||
|
|
|||
| 29 | } |
||
| 30 | |||
| 31 | public function getIdentifier() |
||
| 32 | { |
||
| 33 | return $this->identifier; |
||
| 34 | } |
||
| 35 | |||
| 36 | public function updateStyles($role) |
||
| 37 | { |
||
| 38 | $this->layout = $role . ucfirst($this->layout); |
||
| 39 | $this->style = $role . ucfirst($this->style); |
||
| 40 | $this->textStyle = $role . ucfirst($this->textStyle); |
||
| 41 | |||
| 42 | if (isset($this->components)) { |
||
| 43 | foreach ($this->components as $component) { |
||
| 44 | $component->updateStyles($role); |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | public function __toString() |
||
| 52 | } |
||
| 53 | } |
||
| 54 |