1 | <?php |
||
19 | class IniFileLoader extends AbstractFileLoader |
||
20 | { |
||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $extensions = array('ini', 'env'); |
||
25 | |||
26 | /** |
||
27 | * Assert that value can't be nested array. |
||
28 | * |
||
29 | * @param string $parent |
||
30 | * @param string $child |
||
31 | * @param mixed $value |
||
32 | * |
||
33 | * @throws Exception |
||
34 | */ |
||
35 | private static function assertNoNestedArray($parent, $child, $value) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function import(FileLocator $file) |
||
60 | |||
61 | /** |
||
62 | * {@inheritdoc} |
||
63 | */ |
||
64 | public function write(array $configs, $file) |
||
75 | |||
76 | /** |
||
77 | * Append string from data. |
||
78 | * |
||
79 | * @param string $str |
||
80 | * @param string $name |
||
81 | * @param mixed $value |
||
82 | * |
||
83 | * @throws Exception |
||
84 | */ |
||
85 | private function appendString(&$str, $name, $value) |
||
106 | |||
107 | /** |
||
108 | * Normalize string. |
||
109 | * |
||
110 | * @param string $name |
||
111 | * @param string $value |
||
112 | * |
||
113 | * @return string |
||
114 | */ |
||
115 | private function normalizeString($name, $value) |
||
125 | |||
126 | /** |
||
127 | * Normalize array config. |
||
128 | * |
||
129 | * @param array $configs |
||
130 | * |
||
131 | * @return array |
||
132 | */ |
||
133 | private function normalize(array $configs) |
||
146 | |||
147 | /** |
||
148 | * Mapping type of value. |
||
149 | * |
||
150 | * @param string $value |
||
151 | * |
||
152 | * @return mixed |
||
153 | */ |
||
154 | private function mapValueType($value) |
||
176 | } |
||
177 |