1 | <?php |
||
12 | class Renderer |
||
13 | { |
||
14 | /** |
||
15 | * Constants determining how the library should handle array values. |
||
16 | */ |
||
17 | const ARRAY_MODE_ARRAY = 1; |
||
18 | const ARRAY_MODE_CONCAT = 2; |
||
19 | |||
20 | /** |
||
21 | * Constants determining how the library should handle boolean values. |
||
22 | */ |
||
23 | const BOOLEAN_MODE_INTEGER = 4; |
||
24 | const BOOLEAN_MODE_BOOL_STRING = 8; |
||
25 | const BOOLEAN_MODE_STRING = 16; |
||
26 | |||
27 | const STRING_MODE_QUOTE = 32; |
||
28 | |||
29 | /** |
||
30 | * @var int |
||
31 | */ |
||
32 | protected $flags = 5; |
||
33 | |||
34 | /** |
||
35 | * @param int $flags |
||
36 | */ |
||
37 | 19 | public function __construct($flags = 5) |
|
41 | |||
42 | /** |
||
43 | * Renders an INI configuration. |
||
44 | * |
||
45 | * @param array $ini |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | 18 | public function render(array $ini) |
|
90 | |||
91 | /** |
||
92 | * Renders a key-value pair. |
||
93 | * |
||
94 | * @param string $key |
||
95 | * @param mixed $value |
||
96 | * |
||
97 | * @return array |
||
98 | */ |
||
99 | 17 | protected function renderKeyValuePair($key, $value) |
|
114 | |||
115 | /** |
||
116 | * Normalize value to valid INI format. |
||
117 | * |
||
118 | * @param mixed $value |
||
119 | * |
||
120 | * @return string |
||
121 | */ |
||
122 | 17 | protected function normalizeValue($value) |
|
136 | |||
137 | /** |
||
138 | * Normalizes arrays. |
||
139 | * |
||
140 | * @param array $value |
||
141 | * |
||
142 | * @return array|string |
||
143 | */ |
||
144 | 9 | protected function normalizeArray($value) |
|
171 | |||
172 | /** |
||
173 | * Normalizes a boolean value. |
||
174 | * |
||
175 | * @param bool $value |
||
176 | * |
||
177 | * @return int|string |
||
178 | */ |
||
179 | 4 | protected function normalizeBoolean($value) |
|
199 | |||
200 | /** |
||
201 | * Checks if a flag is active. |
||
202 | * |
||
203 | * @param int $flag |
||
204 | * |
||
205 | * @return bool |
||
206 | */ |
||
207 | 15 | private function checkFlag($flag) |
|
211 | } |
||
212 |
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.