| @@ 290-301 (lines=12) @@ | ||
| 287 | * @return $this |
|
| 288 | * @throws \InvalidArgumentException |
|
| 289 | */ |
|
| 290 | public function append($data) |
|
| 291 | { |
|
| 292 | if (is_array($this->data)) { |
|
| 293 | array_push($this->data, $data); |
|
| 294 | } else if (is_string($data)) { |
|
| 295 | $this->data .= (string) $data; |
|
| 296 | } else { |
|
| 297 | throw new \InvalidArgumentException('$data must be either array nor string.'); |
|
| 298 | } |
|
| 299 | ||
| 300 | return $this; |
|
| 301 | } |
|
| 302 | ||
| 303 | ||
| 304 | /** |
|
| @@ 309-320 (lines=12) @@ | ||
| 306 | * @return $this |
|
| 307 | * @throws \InvalidArgumentException |
|
| 308 | */ |
|
| 309 | public function prepend($data) |
|
| 310 | { |
|
| 311 | if (is_array($this->data)) { |
|
| 312 | array_unshift($this->data, $data); |
|
| 313 | } else if (is_string($data)) { |
|
| 314 | $this->data = (string) $data . $this->data; |
|
| 315 | } else { |
|
| 316 | throw new \InvalidArgumentException('$data must be either array nor string.'); |
|
| 317 | } |
|
| 318 | ||
| 319 | return $this; |
|
| 320 | } |
|
| 321 | ||
| 322 | /** |
|
| 323 | * @param $tagName |
|