Passed
Push — master ( 5f7c52...19fca6 )
by summer
01:54
created
src/AliOssAdapter.php 1 patch
Braces   +16 added lines, -11 removed lines patch added patch discarded remove patch
@@ -271,7 +271,7 @@  discard block
 block discarded – undo
271 271
 
272 272
         try{
273 273
             $this->client->deleteObject($bucket, $object);
274
-        }catch (OssException $e) {
274
+        } catch (OssException $e) {
275 275
             $this->logErr(__FUNCTION__, $e);
276 276
             return false;
277 277
         }
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
 
363 363
                     $result['objects'][] = $object;
364 364
                 }
365
-            }else{
365
+            } else{
366 366
                 $result["objects"] = [];
367 367
             }
368 368
 
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
                 foreach ($prefixList as $prefixInfo) {
371 371
                     $result['prefix'][] = $prefixInfo->getPrefix();
372 372
                 }
373
-            }else{
373
+            } else{
374 374
                 $result['prefix'] = [];
375 375
             }
376 376
 
@@ -526,8 +526,9 @@  discard block
 block discarded – undo
526 526
      */
527 527
     public function getMimetype($path)
528 528
     {
529
-        if( $object = $this->getMetadata($path))
530
-            $object['mimetype'] = $object['content-type'];
529
+        if( $object = $this->getMetadata($path)) {
530
+                    $object['mimetype'] = $object['content-type'];
531
+        }
531 532
         return $object;
532 533
     }
533 534
 
@@ -536,8 +537,9 @@  discard block
 block discarded – undo
536 537
      */
537 538
     public function getTimestamp($path)
538 539
     {
539
-        if( $object = $this->getMetadata($path))
540
-            $object['timestamp'] = strtotime( $object['last-modified'] );
540
+        if( $object = $this->getMetadata($path)) {
541
+                    $object['timestamp'] = strtotime( $object['last-modified'] );
542
+        }
541 543
         return $object;
542 544
     }
543 545
 
@@ -556,7 +558,7 @@  discard block
 block discarded – undo
556 558
 
557 559
         if ($acl == OssClient::OSS_ACL_TYPE_PUBLIC_READ ){
558 560
             $res['visibility'] = AdapterInterface::VISIBILITY_PUBLIC;
559
-        }else{
561
+        } else{
560 562
             $res['visibility'] = AdapterInterface::VISIBILITY_PRIVATE;
561 563
         }
562 564
 
@@ -571,7 +573,9 @@  discard block
 block discarded – undo
571 573
      */
572 574
     public function getUrl( $path )
573 575
     {
574
-        if (!$this->has($path)) throw new FileNotFoundException($path.' not found');
576
+        if (!$this->has($path)) {
577
+            throw new FileNotFoundException($path.' not found');
578
+        }
575 579
         return ( $this->ssl ? 'https://' : 'http://' ) . ( $this->isCname ? ( $this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain ) : $this->bucket . '.' . $this->endPoint ) . '/' . ltrim($path, '/');
576 580
     }
577 581
 
@@ -585,8 +589,9 @@  discard block
 block discarded – undo
585 589
      * @throws OssException
586 590
      */
587 591
     public function getTemporaryUrl($path, $expire = 600, $options) {
588
-        if (!$this->has($path))
589
-            throw new FileNotFoundException($path.' not found');
592
+        if (!$this->has($path)) {
593
+                    throw new FileNotFoundException($path.' not found');
594
+        }
590 595
         $method = OssClient::OSS_HTTP_GET;
591 596
         if (Arr::has($options, OssClient::OSS_METHOD)) {
592 597
             $method = $options['method'];
Please login to merge, or discard this patch.