1 | <?php |
||
12 | abstract class Output |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | protected static $header = [ |
||
18 | 'Source of truth Location', |
||
19 | 'Source of truth File Hash', |
||
20 | 'Target Location', |
||
21 | 'Target File Hash' |
||
22 | ]; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $mask = ''; |
||
28 | |||
29 | /** |
||
30 | * @var bool |
||
31 | */ |
||
32 | protected $headerEnabled; |
||
33 | |||
34 | /** |
||
35 | * @var OutputInterface |
||
36 | */ |
||
37 | protected $output; |
||
38 | |||
39 | /** |
||
40 | * @var ArrayCollection |
||
41 | */ |
||
42 | protected $differences; |
||
43 | |||
44 | /** |
||
45 | * Output constructor. |
||
46 | * @param ArrayCollection $differences |
||
47 | * @param OutputInterface $output |
||
48 | */ |
||
49 | 6 | public function __construct(ArrayCollection $differences, OutputInterface $output) |
|
56 | |||
57 | /** |
||
58 | * @return boolean |
||
59 | */ |
||
60 | 1 | public function isHeaderEnabled() |
|
64 | |||
65 | /** |
||
66 | * @param boolean $headerEnabled |
||
67 | * @return $this |
||
68 | */ |
||
69 | 4 | public function setHeaderEnabled($headerEnabled) |
|
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | 3 | protected function getMask() |
|
82 | |||
83 | /** |
||
84 | * @param DiffItem $diffItem |
||
85 | */ |
||
86 | 3 | protected function writeDiffItem(DiffItem $diffItem) |
|
132 | |||
133 | /** |
||
134 | * @param RosterItem $rosterItem |
||
135 | * @return array |
||
136 | */ |
||
137 | 3 | private function getRosterInfo(RosterItem $rosterItem) |
|
156 | |||
157 | /** |
||
158 | * |
||
159 | */ |
||
160 | abstract public function write(); |
||
161 | |||
162 | /** |
||
163 | * Perform any logic at construction time. |
||
164 | */ |
||
165 | abstract protected function init(); |
||
166 | } |
||
167 |