| Total Complexity | 5 |
| Total Lines | 77 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 23 | abstract class AbstractList extends AbstractHelper |
||
| 24 | { |
||
| 25 | /** |
||
| 26 | * @var array |
||
| 27 | */ |
||
| 28 | protected $attributes = []; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | protected $elementTag = "li"; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @var array |
||
| 37 | */ |
||
| 38 | protected $store = []; |
||
| 39 | |||
| 40 | /** |
||
| 41 | * @param string $indent |
||
| 42 | * @param string $delimiter |
||
| 43 | * @param array $attributes |
||
| 44 | * |
||
| 45 | * @return AbstractList |
||
| 46 | */ |
||
| 47 | 4 | public function __invoke( |
|
| 48 | string $indent = null, |
||
| 49 | string $delimiter = null, |
||
| 50 | array $attributes = [] |
||
| 51 | ): AbstractList { |
||
| 52 | 4 | $this->attributes = $attributes; |
|
| 53 | 4 | if (null !== $delimiter) { |
|
| 54 | 3 | $this->delimiter = $delimiter; |
|
| 55 | } |
||
| 56 | |||
| 57 | 4 | if (null !== $indent) { |
|
| 58 | 3 | $this->indent = $indent; |
|
| 59 | } |
||
| 60 | |||
| 61 | 4 | $this->store = []; |
|
| 62 | |||
| 63 | 4 | return $this; |
|
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * Generates and returns the HTML for the list. |
||
| 68 | * |
||
| 69 | * @return string |
||
| 70 | * @throws Exception |
||
| 71 | */ |
||
| 72 | 4 | public function __toString() |
|
| 89 | ); |
||
| 90 | } |
||
| 91 | |||
| 92 | /** |
||
| 93 | * |
||
| 94 | * Returns the tag name. |
||
| 95 | * |
||
| 96 | * @return string |
||
| 97 | * |
||
| 98 | */ |
||
| 99 | abstract protected function getTag(); |
||
| 100 | } |
||
| 101 |