1 | <?php |
||
8 | class OutputContainer |
||
9 | { |
||
10 | /** |
||
11 | * @var string[] |
||
12 | */ |
||
13 | protected $fileNames; |
||
14 | |||
15 | /** |
||
16 | * @var string[] |
||
17 | */ |
||
18 | protected $outputBuffer; |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $tag; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $title; |
||
29 | |||
30 | /** |
||
31 | * @param string $tag |
||
32 | * @param string $title |
||
33 | */ |
||
34 | 37 | public function __construct($tag, $title) |
|
35 | { |
||
36 | 37 | $this->tag = $tag; |
|
37 | 37 | $this->title = $title; |
|
38 | 37 | $this->fileNames = array(); |
|
39 | 37 | $this->fileNames = array(); |
|
40 | 37 | $this->outputBuffer = array(); |
|
41 | 37 | } |
|
42 | |||
43 | /** |
||
44 | * @param string $fileName |
||
45 | */ |
||
46 | 14 | public function addFileName($fileName) |
|
50 | |||
51 | /** |
||
52 | * @param string|array $output |
||
53 | */ |
||
54 | 10 | public function addToOutputBuffer($output) |
|
55 | { |
||
56 | 10 | if (is_array($output)) { |
|
57 | 10 | foreach ($output as $single) { |
|
58 | 10 | $this->outputBuffer[] = $single; |
|
59 | 10 | } |
|
60 | 10 | } else { |
|
61 | $this->outputBuffer[] = $output; |
||
62 | } |
||
63 | 10 | } |
|
64 | |||
65 | /** |
||
66 | * @return \string[] |
||
67 | */ |
||
68 | 6 | public function getFileNames() |
|
72 | |||
73 | /** |
||
74 | * @return string[] |
||
75 | */ |
||
76 | 26 | public function getOutputBuffer() |
|
80 | |||
81 | /** |
||
82 | * @return int |
||
83 | */ |
||
84 | 7 | public function countFiles() |
|
85 | { |
||
86 | 7 | return count($this->fileNames); |
|
87 | } |
||
88 | |||
89 | /** |
||
90 | * @return string |
||
91 | */ |
||
92 | 6 | public function getTag() |
|
96 | |||
97 | /** |
||
98 | * @return string |
||
99 | */ |
||
100 | 6 | public function getTitle() |
|
104 | } |
||
105 |