| Total Complexity | 4 |
| Total Lines | 33 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | abstract class Html { |
||
| 9 | |||
| 10 | /** @var string */ |
||
| 11 | protected $name; |
||
| 12 | |||
| 13 | /** @var string[] */ |
||
| 14 | protected $attributes; |
||
| 15 | |||
| 16 | /** @return string */ |
||
| 17 | abstract public function html(); |
||
| 18 | |||
| 19 | /** |
||
| 20 | * Cria o elemento |
||
| 21 | * @param string $name |
||
| 22 | * @param string[] $attributes |
||
| 23 | */ |
||
| 24 | public function __construct($name, $attributes) { |
||
| 25 | $this->name = $name; |
||
| 26 | $this->attributes = $attributes; |
||
| 27 | } |
||
| 28 | |||
| 29 | /** @return string */ |
||
| 30 | protected function attributes() { |
||
| 31 | $html = ''; |
||
| 32 | foreach ($this->attributes as $name => $value) { |
||
| 33 | $html .= $name . '="' . $value . '" '; |
||
| 34 | } |
||
| 35 | return $html; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** @return string */ |
||
| 39 | public function __toString() { |
||
| 41 | } |
||
| 42 | |||
| 43 | } |
||
| 44 |