1 | <?php |
||
17 | class Writer { |
||
18 | |||
19 | /** |
||
20 | * @var string $indent The string to ident each level with. Default is a tab. |
||
21 | */ |
||
22 | public $indent = "\t"; |
||
23 | |||
24 | /** |
||
25 | * @var string $newLine The string to use as a new line or linebreak. Defaults to \r\n. |
||
26 | */ |
||
27 | public $newLine = "\r\n"; |
||
28 | |||
29 | /** |
||
30 | * @param array $options allows you to set the indent and newLine |
||
31 | * options immediately upon construction |
||
32 | */ |
||
33 | 2 | public function __construct( $options = []) |
|
34 | { |
||
35 | 2 | $optionList = [ 'indent', 'newLine' ]; |
|
36 | 2 | foreach( $options as $option => $optionValue) { |
|
37 | if (in_array( $option, $optionList )) { |
||
38 | $this->{$option} = $optionValue; |
||
39 | } |
||
40 | } |
||
41 | 2 | } |
|
42 | |||
43 | 6 | public function __call( $name, $args) |
|
47 | |||
48 | } |
||
49 |