Total Complexity | 7 |
Total Lines | 39 |
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() |
||
22 | { |
||
23 | return $this->role; |
||
24 | } |
||
25 | |||
26 | public function updateStyles($role) |
||
27 | { |
||
28 | $this->layout = $role . ucfirst($this->layout); |
||
29 | $this->style = $role . ucfirst($this->style); |
||
30 | $this->textStyle = $role . ucfirst($this->textStyle); |
||
31 | |||
32 | if (isset($this->components)) { |
||
33 | foreach ($this->components as $component) { |
||
34 | $component->updateStyles($role); |
||
35 | } |
||
36 | } |
||
37 | } |
||
38 | |||
39 | public function __toString() |
||
42 | } |
||
43 | } |
||
44 |