| Total Complexity | 7 |
| Total Lines | 52 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php namespace FlatPlan\Components; |
||
| 3 | class Text extends AbstractComponent { |
||
| 4 | |||
| 5 | protected $text; |
||
| 6 | protected $format; |
||
| 7 | protected $textStyle; |
||
| 8 | |||
| 9 | protected $formats = ['html', 'markdown', 'none']; |
||
| 10 | protected $roles = ['body', 'title', 'heading', 'intro', 'caption', 'author', 'byline', 'illustrator', 'photographer', 'quote', 'pullquote']; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * @param string $role |
||
| 14 | * @param string $text |
||
| 15 | * @param string $format |
||
| 16 | * @return void |
||
| 17 | */ |
||
| 18 | public function __construct($role, $text, $format = 'none') |
||
| 19 | { |
||
| 20 | $this->setRole($role); |
||
| 21 | $this->setText($text); |
||
| 22 | $this->setFormat($format); |
||
| 23 | } |
||
| 24 | |||
| 25 | private function setText($text) |
||
| 26 | { |
||
| 27 | $this->text = $text; |
||
| 28 | } |
||
| 29 | |||
| 30 | private function getText() |
||
| 31 | { |
||
| 32 | return $this->text; |
||
| 33 | } |
||
| 34 | |||
| 35 | private function setFormat($format = null) |
||
| 41 | } |
||
| 42 | |||
| 43 | private function getFormat() |
||
| 44 | { |
||
| 45 | return $this->format; |
||
| 46 | } |
||
| 47 | |||
| 48 | protected function getComponent() |
||
| 55 | } |
||
| 56 | } |
||
| 57 |