1 | <?php |
||
35 | class Properties extends AbstractFileParser |
||
36 | { |
||
37 | /** |
||
38 | * Parsed configuration file. |
||
39 | * |
||
40 | * @var array $parsedFile |
||
41 | * |
||
42 | * @since 0.2.5 |
||
43 | */ |
||
44 | protected $parsedFile; |
||
45 | |||
46 | /** |
||
47 | * Loads a PROPERTIES file as an array. |
||
48 | * |
||
49 | * @param string $path File path |
||
50 | * |
||
51 | * @throws ParseException If there is an error parsing PROPERTIES file |
||
52 | * |
||
53 | * @return array The parsed data |
||
54 | * |
||
55 | * @since 0.2.4 |
||
56 | */ |
||
57 | public function parse($path) |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | * |
||
80 | * @return array Supported extensions |
||
81 | * |
||
82 | * @since 0.1.0 |
||
83 | */ |
||
84 | public function getSupportedFileExtensions() |
||
88 | |||
89 | /** |
||
90 | * Parse Java-Properties |
||
91 | * |
||
92 | * @param string|null $string The string to parse |
||
93 | * |
||
94 | * @return array The parsed data |
||
95 | * @since 0.2.6 |
||
96 | * @codeCoverageIgnore |
||
97 | */ |
||
98 | private function parseProperties($string = null) |
||
159 | |||
160 | /** |
||
161 | * Loads in the given file and parses it. |
||
162 | * |
||
163 | * @param string|bool|null $file File to load |
||
164 | * |
||
165 | * @return array The parsed file data |
||
166 | * |
||
167 | * @since 0.2.4 |
||
168 | * @codeCoverageIgnore |
||
169 | */ |
||
170 | protected function loadFile($file = null) |
||
180 | |||
181 | /** |
||
182 | * Returns the formatted configuration file contents. |
||
183 | * |
||
184 | * @param array $contents configuration array |
||
185 | * |
||
186 | * @return string formatted configuration file contents |
||
187 | * |
||
188 | * @since 0.2.4 |
||
189 | * @codeCoverageIgnore |
||
190 | */ |
||
191 | protected function exportFormat($contents = null) |
||
197 | |||
198 | /** |
||
199 | * __toString. |
||
200 | * |
||
201 | * @return string |
||
202 | * @since 0.1.2 |
||
203 | * @codeCoverageIgnore |
||
204 | */ |
||
205 | public function __toString() |
||
209 | } |
||
210 | |||
212 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.