| @@ 186-197 (lines=12) @@ | ||
| 183 | * @return $this |
|
| 184 | * @throws \InvalidArgumentException |
|
| 185 | */ |
|
| 186 | public function append($data) |
|
| 187 | { |
|
| 188 | if (is_array($this->data)) { |
|
| 189 | array_push($this->data, $data); |
|
| 190 | } else if (is_string($data)) { |
|
| 191 | $this->data .= (string) $data; |
|
| 192 | } else { |
|
| 193 | throw new \InvalidArgumentException('$data must be either array nor string.'); |
|
| 194 | } |
|
| 195 | ||
| 196 | return $this; |
|
| 197 | } |
|
| 198 | ||
| 199 | ||
| 200 | /** |
|
| @@ 205-216 (lines=12) @@ | ||
| 202 | * @return $this |
|
| 203 | * @throws \InvalidArgumentException |
|
| 204 | */ |
|
| 205 | public function prepend($data) |
|
| 206 | { |
|
| 207 | if (is_array($this->data)) { |
|
| 208 | array_unshift($this->data, $data); |
|
| 209 | } else if (is_string($data)) { |
|
| 210 | $this->data = (string) $data . $this->data; |
|
| 211 | } else { |
|
| 212 | throw new \InvalidArgumentException('$data must be either array nor string.'); |
|
| 213 | } |
|
| 214 | ||
| 215 | return $this; |
|
| 216 | } |
|
| 217 | ||
| 218 | /** |
|
| 219 | * @param $tagName |
|