1 | <?php |
||
34 | class Ini extends AbstractFileParser |
||
35 | { |
||
36 | /** |
||
37 | * Parses an INI file as an array. |
||
38 | * |
||
39 | * @param string $path File path |
||
40 | * |
||
41 | * @throws ParseException If there is an error parsing INI file |
||
42 | * |
||
43 | * @return array The parsed data |
||
44 | * |
||
45 | * @since 0.1.0 |
||
46 | */ |
||
47 | 6 | public function parse($path) |
|
57 | |||
58 | /** |
||
59 | * {@inheritdoc} |
||
60 | * |
||
61 | * @return array Supported extensions |
||
62 | * |
||
63 | * @since 0.1.0 |
||
64 | */ |
||
65 | 3 | public function getSupportedFileExtensions() |
|
69 | |||
70 | /** |
||
71 | * Loads in the given file and parses it. |
||
72 | * |
||
73 | * @param string $file File to load |
||
74 | * |
||
75 | * @return array The parsed file data |
||
76 | * |
||
77 | * @since 0.2.4 |
||
78 | * @codeCoverageIgnore |
||
79 | */ |
||
80 | protected function loadFile($file = null) |
||
87 | |||
88 | /** |
||
89 | * Returns the formatted configuration file contents. |
||
90 | * |
||
91 | * @param array $contents configuration array |
||
92 | * |
||
93 | * @return string formatted configuration file contents |
||
94 | * |
||
95 | * @since 0.2.4 |
||
96 | * @codeCoverageIgnore |
||
97 | */ |
||
98 | protected function exportFormat($contents = null) |
||
104 | |||
105 | /** |
||
106 | * __toString. |
||
107 | * |
||
108 | * @return string |
||
109 | * @since 0.1.2 |
||
110 | * @codeCoverageIgnore |
||
111 | */ |
||
112 | public function __toString() |
||
116 | } |
||
117 | |||
119 |
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.