Completed
Push — master ( da9025...5f7c52 )
by summer
20s
created
src/Plugins/SignUrl.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,9 @@
 block discarded – undo
25 25
     }
26 26
 
27 27
     public function handle($path, $timeout = 600){
28
-        if (!$this->filesystem->getAdapter()->has($path)) throw new FileNotFoundException($path.' not found');
28
+        if (!$this->filesystem->getAdapter()->has($path)) {
29
+            throw new FileNotFoundException($path.' not found');
30
+        }
29 31
         return $this->filesystem->getAdapter()->getClient()->signUrl($this->filesystem->getAdapter()->getBucket(),$path,$timeout);
30 32
     }
31 33
 }
Please login to merge, or discard this patch.
src/AliOssServiceProvider.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,9 @@
 block discarded – undo
45 45
             $endPoint  = $config['endpoint']; // 默认作为外部节点
46 46
             $epInternal= $isCname?$cdnDomain:(empty($config['endpoint_internal']) ? $endPoint : $config['endpoint_internal']); // 内部节点
47 47
 
48
-            if($debug) Log::debug('OSS config:', $config);
48
+            if($debug) {
49
+                Log::debug('OSS config:', $config);
50
+            }
49 51
 
50 52
             $client  = new OssClient($accessId, $accessKey, $epInternal, $isCname);
51 53
             $adapter = new AliOssAdapter($client, $bucket, $endPoint, $ssl, $isCname, $debug, $cdnDomain);
Please login to merge, or discard this patch.
src/AliOssAdapter.php 1 patch
Braces   +16 added lines, -11 removed lines patch added patch discarded remove patch
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 
271 271
         try{
272 272
             $this->client->deleteObject($bucket, $object);
273
-        }catch (OssException $e) {
273
+        } catch (OssException $e) {
274 274
             $this->logErr(__FUNCTION__, $e);
275 275
             return false;
276 276
         }
@@ -361,7 +361,7 @@  discard block
 block discarded – undo
361 361
 
362 362
                     $result['objects'][] = $object;
363 363
                 }
364
-            }else{
364
+            } else{
365 365
                 $result["objects"] = [];
366 366
             }
367 367
 
@@ -369,7 +369,7 @@  discard block
 block discarded – undo
369 369
                 foreach ($prefixList as $prefixInfo) {
370 370
                     $result['prefix'][] = $prefixInfo->getPrefix();
371 371
                 }
372
-            }else{
372
+            } else{
373 373
                 $result['prefix'] = [];
374 374
             }
375 375
 
@@ -525,8 +525,9 @@  discard block
 block discarded – undo
525 525
      */
526 526
     public function getMimetype($path)
527 527
     {
528
-        if( $object = $this->getMetadata($path))
529
-            $object['mimetype'] = $object['content-type'];
528
+        if( $object = $this->getMetadata($path)) {
529
+                    $object['mimetype'] = $object['content-type'];
530
+        }
530 531
         return $object;
531 532
     }
532 533
 
@@ -535,8 +536,9 @@  discard block
 block discarded – undo
535 536
      */
536 537
     public function getTimestamp($path)
537 538
     {
538
-        if( $object = $this->getMetadata($path))
539
-            $object['timestamp'] = strtotime( $object['last-modified'] );
539
+        if( $object = $this->getMetadata($path)) {
540
+                    $object['timestamp'] = strtotime( $object['last-modified'] );
541
+        }
540 542
         return $object;
541 543
     }
542 544
 
@@ -555,7 +557,7 @@  discard block
 block discarded – undo
555 557
 
556 558
         if ($acl == OssClient::OSS_ACL_TYPE_PUBLIC_READ ){
557 559
             $res['visibility'] = AdapterInterface::VISIBILITY_PUBLIC;
558
-        }else{
560
+        } else{
559 561
             $res['visibility'] = AdapterInterface::VISIBILITY_PRIVATE;
560 562
         }
561 563
 
@@ -570,7 +572,9 @@  discard block
 block discarded – undo
570 572
      */
571 573
     public function getUrl( $path )
572 574
     {
573
-        if (!$this->has($path)) throw new FileNotFoundException($path.' not found');
575
+        if (!$this->has($path)) {
576
+            throw new FileNotFoundException($path.' not found');
577
+        }
574 578
         return ( $this->ssl ? 'https://' : 'http://' ) . ( $this->isCname ? ( $this->cdnDomain == '' ? $this->endPoint : $this->cdnDomain ) : $this->bucket . '.' . $this->endPoint ) . '/' . ltrim($path, '/');
575 579
     }
576 580
     
@@ -584,8 +588,9 @@  discard block
 block discarded – undo
584 588
      * @throws OssException
585 589
      */
586 590
     public function getTemporaryUrl($path, $expire, $options) {
587
-        if (!$this->has($path))
588
-            throw new FileNotFoundException($path.' not found');
591
+        if (!$this->has($path)) {
592
+                    throw new FileNotFoundException($path.' not found');
593
+        }
589 594
         $method = OssClient::OSS_HTTP_GET;
590 595
         if (Arr::has($options, OssClient::OSS_METHOD)) {
591 596
             $method = $options['method'];
Please login to merge, or discard this patch.