1 | <?php |
||
14 | class Writer |
||
15 | { |
||
16 | |||
17 | const DEFAULT_PREFACE = '# Generated with Jalle19/haphproxy'; |
||
18 | const DEFAULT_INDENT = ' '; |
||
19 | |||
20 | /** |
||
21 | * @var Configuration |
||
22 | */ |
||
23 | private $configuration; |
||
24 | |||
25 | /** |
||
26 | * @var string |
||
27 | */ |
||
28 | private $preface = self::DEFAULT_PREFACE; |
||
29 | |||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | private $indent = self::DEFAULT_INDENT; |
||
34 | |||
35 | |||
36 | /** |
||
37 | * Writer constructor. |
||
38 | * |
||
39 | * @param Configuration $configuration |
||
40 | */ |
||
41 | public function __construct(Configuration $configuration) |
||
45 | |||
46 | |||
47 | /** |
||
48 | * @param Configuration $configuration |
||
49 | */ |
||
50 | public function setConfiguration($configuration) |
||
54 | |||
55 | |||
56 | /** |
||
57 | * @param string $preface |
||
58 | */ |
||
59 | public function setPreface($preface) |
||
63 | |||
64 | |||
65 | /** |
||
66 | * @param string $indent |
||
67 | */ |
||
68 | public function setIndent($indent) |
||
72 | |||
73 | |||
74 | /** |
||
75 | * @return string the configuration as a string |
||
76 | */ |
||
77 | public function dump() |
||
99 | |||
100 | |||
101 | /** |
||
102 | * @param Parameter $parameter |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | private function writeParameter(Parameter $parameter) |
||
116 | |||
117 | } |
||
118 |