Passed
Pull Request — master (#42)
by sabaku
08:36
created
src/Upyun/Upyun.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         $params = Util::getHeaderParams($response->getHeaders());
153 153
 
154 154
 
155
-        if (! isset($params['x-upyun-list-iter'])) {
155
+        if (!isset($params['x-upyun-list-iter'])) {
156 156
             if (is_resource($saveHandler)) {
157 157
                 Psr7\copy_to_stream($response->getBody(), Psr7\stream_for($saveHandler));
158 158
                 return true;
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      */
257 257
     public function createDir($path)
258 258
     {
259
-        $path = rtrim($path, '/') . '/';
259
+        $path = rtrim($path, '/').'/';
260 260
         $req = new Rest($this->config);
261 261
         $res = $req->request('POST', $path)
262 262
             ->withHeader('folder', 'true')
@@ -286,9 +286,9 @@  discard block
 block discarded – undo
286 286
      */
287 287
     public function usage($path = '/')
288 288
     {
289
-        $path = rtrim($path, '/') . '/';
289
+        $path = rtrim($path, '/').'/';
290 290
         $req = new Rest($this->config);
291
-        $response = $req->request('GET', $path . '?usage')
291
+        $response = $req->request('GET', $path.'?usage')
292 292
             ->send();
293 293
 
294 294
         return $response->getBody()->getContents();
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
         $video = new Api\Pretreat($this->config);
364 364
 
365 365
         $options = array();
366
-        switch($type) {
366
+        switch ($type) {
367 367
             case self::$PROCESS_TYPE_MEDIA:
368 368
                 $options['accept'] = 'json';
369 369
                 $options['source'] = $source;
Please login to merge, or discard this patch.
tests/UpyunTest.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $config->setFormApiKey('Mv83tlocuzkmfKKUFbz2s04FzTw=');
24 24
         $config->processNotifyUrl = 'http://localhost:9999';
25 25
         self::$upyun        = new Upyun($config);
26
-        self::$tempFilePath = __DIR__ . '/assets/test.txt';
26
+        self::$tempFilePath = __DIR__.'/assets/test.txt';
27 27
         touch(self::$tempFilePath);
28 28
     }
29 29
 
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
     public function testWriteStream()
45 45
     {
46 46
         $filename = 'test.jpeg';
47
-        $f = fopen(__DIR__ . '/assets/sample.jpeg', 'rb');
47
+        $f = fopen(__DIR__.'/assets/sample.jpeg', 'rb');
48 48
         if (!$f) {
49 49
             throw new \Exception('open test file failed!');
50 50
         }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $filename = 'test_async.jpeg';
59 59
         $newFilename = 'test_async.png';
60
-        $f = fopen(__DIR__ . '/assets/sample.jpeg', 'rb');
60
+        $f = fopen(__DIR__.'/assets/sample.jpeg', 'rb');
61 61
         if (!$f) {
62 62
             throw new \Exception('open test file failed!');
63 63
         }
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
         try {
82 82
             $fs->write('test.txt', 'test file content');
83 83
         } catch (\Exception $e) {
84
-            return ;
84
+            return;
85 85
         }
86 86
         throw new \Exception('should get sign error.');
87 87
     }
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
         try {
116 116
             self::$upyun->read('test-delete.txt');
117 117
         } catch (\Exception $e) {
118
-            return ;
118
+            return;
119 119
         }
120 120
         throw new \Exception('delete file failed');
121 121
     }
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     public function testProcess()
218 218
     {
219 219
         $source = 'php-sdk-sample.mp4';
220
-        self::$upyun->write($source, fopen(__DIR__ . '/assets/SampleVideo_640x360_1mb.mp4', 'r'));
220
+        self::$upyun->write($source, fopen(__DIR__.'/assets/SampleVideo_640x360_1mb.mp4', 'r'));
221 221
         $result = self::$upyun->process(array(
222 222
             array('type' => 'video', 'avopts' => '/s/240p(4:3)/as/1/r/30', 'return_info' => true, 'save_as' => '/video/result.mp4')
223 223
         ), Upyun::$PROCESS_TYPE_MEDIA, $source);
Please login to merge, or discard this patch.