@@ -112,9 +112,11 @@ public function getInfo()
112112 protected static function getX ($ headers , $ prefix = 'x- ' )
113113 {
114114 $ result = array ();
115- foreach ($ headers as $ key => $ value )
116- if (stripos ($ key , $ prefix ) === 0 )
115+ foreach ($ headers as $ key => $ value ) {
116+ if (stripos ($ key , $ prefix ) === 0 ) {
117117 $ result [$ key ] = $ value ;
118+ }
119+ }
118120 return $ result ;
119121 }
120122
@@ -141,8 +143,9 @@ public function listContainers($limit = 10000, $marker = '', $format = null)
141143 ->request ("GET " )
142144 ->getContent ();
143145
144- if ($ params ['format ' ] == '' )
146+ if ($ params ['format ' ] == '' ) {
145147 return explode ("\n" , trim ($ cont ));
148+ }
146149
147150 return trim ($ cont );
148151 }
@@ -164,8 +167,9 @@ public function createContainer($name, $headers = array())
164167 ->request ("PUT " )
165168 ->getInfo ();
166169
167- if (!in_array ($ info ["http_code " ], array (201 , 202 )))
170+ if (!in_array ($ info ["http_code " ], array (201 , 202 ))) {
168171 return $ this ->error ($ info ["http_code " ], __METHOD__ );
172+ }
169173
170174 return $ this ->getContainer ($ name );
171175 }
@@ -185,8 +189,9 @@ public function getContainer($name)
185189 ->request ("HEAD " )
186190 ->getHeaders ();
187191
188- if (!in_array ($ headers ["HTTP-Code " ], array (204 )))
192+ if (!in_array ($ headers ["HTTP-Code " ], array (204 ))) {
189193 return $ this ->error ($ headers ["HTTP-Code " ], __METHOD__ );
194+ }
190195
191196 return new SelectelContainer ($ url , $ this ->token , $ this ->format , $ this ->getX ($ headers ));
192197 }
@@ -205,8 +210,9 @@ public function delete($name)
205210 ->request ("DELETE " )
206211 ->getInfo ();
207212
208- if (!in_array ($ info ["http_code " ], array (204 )))
213+ if (!in_array ($ info ["http_code " ], array (204 ))) {
209214 return $ this ->error ($ info ["http_code " ], __METHOD__ );
215+ }
210216
211217 return $ info ;
212218 }
@@ -235,8 +241,9 @@ public function copy($origin, $destin)
235241 public function setContainerHeaders ($ name , $ headers )
236242 {
237243 $ headers = $ this ->getX ($ headers , "X-Container-Meta- " );
238- if (get_class ($ this ) != 'SelectelStorage ' )
244+ if (get_class ($ this ) != 'SelectelStorage ' ) {
239245 return 0 ;
246+ }
240247
241248 return $ this ->setMetaInfo ($ name , $ headers );
242249 }
@@ -251,20 +258,22 @@ public function setContainerHeaders($name, $headers)
251258 */
252259 protected function setMetaInfo ($ name , $ headers )
253260 {
254- if (get_class ($ this ) == 'SelectelStorage ' )
261+ if (get_class ($ this ) == 'SelectelStorage ' ) {
255262 $ headers = $ this ->getX ($ headers , "X-Container-Meta- " );
256- elseif (get_class ($ this ) == 'SelectelContainer ' )
263+ } elseif (get_class ($ this ) == 'SelectelContainer ' ) {
257264 $ headers = $ this ->getX ($ headers , "X-Container-Meta- " );
258- else
265+ } else {
259266 return 0 ;
267+ }
260268
261269 $ info = SCurl::init ($ this ->url . $ name )
262270 ->setHeaders ($ headers )
263271 ->request ("POST " )
264272 ->getInfo ();
265273
266- if (!in_array ($ info ["http_code " ], array (204 )))
274+ if (!in_array ($ info ["http_code " ], array (204 ))) {
267275 return $ this ->error ($ info ["http_code " ], __METHOD__ );
276+ }
268277
269278 return $ info ["http_code " ];
270279 }
@@ -322,8 +331,9 @@ public function setAccountMetaTempURLKey($key)
322331 ->request ("POST " )
323332 ->getHeaders ();
324333
325- if (!in_array ($ res ["HTTP-Code " ], array (202 )))
334+ if (!in_array ($ res ["HTTP-Code " ], array (202 ))) {
326335 return $ this ->error ($ res ["HTTP-Code " ], __METHOD__ );
336+ }
327337
328338 return $ res ["HTTP-Code " ];
329339 }
0 commit comments