1 | <?php |
||
15 | class Writer |
||
16 | { |
||
17 | |||
18 | const DEFAULT_INDENT = ' '; |
||
19 | |||
20 | /** |
||
21 | * @var Configuration |
||
22 | */ |
||
23 | private $configuration; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $indent = self::DEFAULT_INDENT; |
||
29 | |||
30 | |||
31 | /** |
||
32 | * Writer constructor. |
||
33 | * |
||
34 | * @param Configuration $configuration |
||
35 | */ |
||
36 | public function __construct(Configuration $configuration) |
||
40 | |||
41 | |||
42 | /** |
||
43 | * @param Configuration $configuration |
||
44 | */ |
||
45 | public function setConfiguration($configuration) |
||
49 | |||
50 | |||
51 | /** |
||
52 | * @param string $indent |
||
53 | */ |
||
54 | public function setIndent($indent) |
||
58 | |||
59 | |||
60 | /** |
||
61 | * @return string the configuration as a string |
||
62 | */ |
||
63 | public function dump() |
||
84 | |||
85 | |||
86 | /** |
||
87 | * @param AbstractSection $section |
||
88 | * |
||
89 | * @return string |
||
90 | */ |
||
91 | private function writeSection(AbstractSection $section) |
||
103 | |||
104 | |||
105 | /** |
||
106 | * @param string $magicComment |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | private function writeMagicComment($magicComment) |
||
114 | |||
115 | |||
116 | /** |
||
117 | * @param Parameter $parameter |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | private function writeParameter(Parameter $parameter) |
||
131 | |||
132 | } |
||
133 |