@@ -128,9 +128,12 @@ discard block |
||
128 | 128 | */ |
129 | 129 | public function size( string $path ) : int |
130 | 130 | { |
131 | - try { |
|
131 | + try |
|
132 | + { |
|
132 | 133 | $size = $this->getProvider()->getSize( $path ); |
133 | - } catch( \Exception $e ) { |
|
134 | + } |
|
135 | + catch( \Exception $e ) |
|
136 | + { |
|
134 | 137 | throw new Exception( $e->getMessage(), 0, $e ); |
135 | 138 | } |
136 | 139 | |
@@ -151,9 +154,12 @@ discard block |
||
151 | 154 | */ |
152 | 155 | public function time( string $path ) : int |
153 | 156 | { |
154 | - try { |
|
157 | + try |
|
158 | + { |
|
155 | 159 | $time = $this->getProvider()->getTimestamp( $path ); |
156 | - } catch( \Exception $e ) { |
|
160 | + } |
|
161 | + catch( \Exception $e ) |
|
162 | + { |
|
157 | 163 | throw new Exception( $e->getMessage(), 0, $e ); |
158 | 164 | } |
159 | 165 | |
@@ -174,9 +180,12 @@ discard block |
||
174 | 180 | */ |
175 | 181 | public function rm( string $path ) : Iface |
176 | 182 | { |
177 | - try { |
|
183 | + try |
|
184 | + { |
|
178 | 185 | $this->getProvider()->delete( $path ); |
179 | - } catch( \Exception $e ) { |
|
186 | + } |
|
187 | + catch( \Exception $e ) |
|
188 | + { |
|
180 | 189 | throw new Exception( $e->getMessage(), 0, $e ); |
181 | 190 | } |
182 | 191 | |
@@ -207,9 +216,12 @@ discard block |
||
207 | 216 | */ |
208 | 217 | public function read( string $path ) : string |
209 | 218 | { |
210 | - try { |
|
219 | + try |
|
220 | + { |
|
211 | 221 | $content = $this->getProvider()->read( $path ); |
212 | - } catch( \Exception $e ) { |
|
222 | + } |
|
223 | + catch( \Exception $e ) |
|
224 | + { |
|
213 | 225 | throw new Exception( $e->getMessage(), 0, $e ); |
214 | 226 | } |
215 | 227 | |
@@ -262,9 +274,12 @@ discard block |
||
262 | 274 | */ |
263 | 275 | public function reads( string $path ) |
264 | 276 | { |
265 | - try { |
|
277 | + try |
|
278 | + { |
|
266 | 279 | $handle = $this->getProvider()->readStream( $path ); |
267 | - } catch( \Exception $e ) { |
|
280 | + } |
|
281 | + catch( \Exception $e ) |
|
282 | + { |
|
268 | 283 | throw new Exception( $e->getMessage(), 0, $e ); |
269 | 284 | } |
270 | 285 | |
@@ -288,9 +303,12 @@ discard block |
||
288 | 303 | */ |
289 | 304 | public function write( string $path, string $content ) : Iface |
290 | 305 | { |
291 | - try { |
|
306 | + try |
|
307 | + { |
|
292 | 308 | $result = $this->getProvider()->put( $path, $content ); |
293 | - } catch( \Exception $e ) { |
|
309 | + } |
|
310 | + catch( \Exception $e ) |
|
311 | + { |
|
294 | 312 | throw new Exception( $e->getMessage(), 0, $e ); |
295 | 313 | } |
296 | 314 | |
@@ -340,9 +358,12 @@ discard block |
||
340 | 358 | */ |
341 | 359 | public function writes( string $path, $stream ) : Iface |
342 | 360 | { |
343 | - try { |
|
361 | + try |
|
362 | + { |
|
344 | 363 | $result = $this->getProvider()->putStream( $path, $stream ); |
345 | - } catch( \Exception $e ) { |
|
364 | + } |
|
365 | + catch( \Exception $e ) |
|
366 | + { |
|
346 | 367 | throw new Exception( $e->getMessage(), 0, $e ); |
347 | 368 | } |
348 | 369 | |
@@ -364,9 +385,12 @@ discard block |
||
364 | 385 | */ |
365 | 386 | public function move( string $from, string $to ) : Iface |
366 | 387 | { |
367 | - try { |
|
388 | + try |
|
389 | + { |
|
368 | 390 | $result = $this->getProvider()->rename( $from, $to ); |
369 | - } catch( \Exception $e ) { |
|
391 | + } |
|
392 | + catch( \Exception $e ) |
|
393 | + { |
|
370 | 394 | throw new Exception( $e->getMessage(), 0, $e ); |
371 | 395 | } |
372 | 396 | |
@@ -388,9 +412,12 @@ discard block |
||
388 | 412 | */ |
389 | 413 | public function copy( string $from, string $to ) : Iface |
390 | 414 | { |
391 | - try { |
|
415 | + try |
|
416 | + { |
|
392 | 417 | $result = $this->getProvider()->copy( $from, $to ); |
393 | - } catch( \Exception $e ) { |
|
418 | + } |
|
419 | + catch( \Exception $e ) |
|
420 | + { |
|
394 | 421 | throw new Exception( $e->getMessage(), 0, $e ); |
395 | 422 | } |
396 | 423 |