@@ 80-89 (lines=10) @@ | ||
77 | if (is_string($content)) { |
|
78 | $lineOfContent = $this->getLineGenerator($indention . $content); |
|
79 | $this->content[] = $lineOfContent; |
|
80 | } else if (is_array($content)) { |
|
81 | foreach ($content as $part) { |
|
82 | $this->add($part); |
|
83 | } |
|
84 | } else if ($content instanceof AbstractContentGenerator) { |
|
85 | $content->setIndention($this->getIndention()); |
|
86 | $this->content[] = $content; |
|
87 | } else { |
|
88 | throw new InvalidArgumentException('content has to be string, an array or instance of AbstractContentGenerator'); |
|
89 | } |
|
90 | ||
91 | return $this; |
|
92 | } |
@@ 33-44 (lines=12) @@ | ||
30 | $this->content[] = $content; |
|
31 | } else if ($content instanceof LineGenerator) { |
|
32 | $this->content[] = $content->generate(); |
|
33 | } else if (is_array($content)) { |
|
34 | foreach ($content as $part) { |
|
35 | $this->add($part); |
|
36 | } |
|
37 | } else if ($content instanceof AbstractContentGenerator) { |
|
38 | $content->setIndention($this->getIndention()); |
|
39 | if ($content->hasContent()) { |
|
40 | $this->content[] = $content->generate(); |
|
41 | } |
|
42 | } else { |
|
43 | throw new InvalidArgumentException('content has to be string, an array or instance of AbstractContentGenerator'); |
|
44 | } |
|
45 | ||
46 | return $this; |
|
47 | } |