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