| Total Complexity | 6 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | trait Traits_Attributable |
||
| 8 | { |
||
| 9 | abstract public function getAttributes() : AttributeCollection; |
||
| 10 | |||
| 11 | public function hasAttributes() : bool |
||
| 12 | { |
||
| 13 | return $this->getAttributes()->hasAttributes(); |
||
| 14 | } |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @param string $name |
||
| 18 | * @param string|number|bool|Interface_Stringable|StringBuilder_Interface|NULL $value |
||
| 19 | * @return $this |
||
| 20 | */ |
||
| 21 | public function attr(string $name, $value) |
||
| 25 | } |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @param string $name |
||
| 29 | * @param string $value |
||
| 30 | * @return $this |
||
| 31 | */ |
||
| 32 | public function attrURL(string $name, string $value) |
||
| 33 | { |
||
| 34 | $this->getAttributes()->attrURL($name, $value); |
||
| 35 | return $this; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param string $name |
||
| 40 | * @param string|number|bool|Interface_Stringable|StringBuilder_Interface|NULL $value |
||
| 41 | * @return $this |
||
| 42 | */ |
||
| 43 | public function attrQuotes(string $name, $value) |
||
| 44 | { |
||
| 45 | $this->getAttributes()->attrQuotes($name, $value); |
||
| 46 | return $this; |
||
| 47 | } |
||
| 48 | |||
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $name |
||
| 52 | * @param bool $enabled |
||
| 53 | * @return $this |
||
| 54 | */ |
||
| 55 | public function prop(string $name, bool $enabled=true) |
||
| 56 | { |
||
| 57 | $this->getAttributes()->prop($name, $enabled); |
||
| 58 | return $this; |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @param string $name |
||
| 63 | * @return $this |
||
| 64 | */ |
||
| 65 | public function removeAttribute(string $name) |
||
| 69 | } |
||
| 70 | } |
||
| 71 |