Passed
Push — develop ( e781d4...f14308 )
by Henry
03:02
created
src/Controllers/MediaRequestHandler.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 
46 46
     public $searchConditions = [
47 47
         'Caption' => [
48
-            'qualifiers' => ['any','caption']
48
+            'qualifiers' => ['any', 'caption']
49 49
             ,'points' => 2
50 50
             ,'sql' => 'Caption LIKE "%%%s%%"',
51 51
         ]
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         } elseif ($_SERVER['REQUEST_METHOD'] == 'PUT') {
203 203
             $put = fopen(static::$inputStream, 'r'); // open input stream
204 204
 
205
-            $tmp = tempnam('/tmp', 'dvr');  // use PHP to make a temporary file
205
+            $tmp = tempnam('/tmp', 'dvr'); // use PHP to make a temporary file
206 206
             $fp = fopen($tmp, 'w'); // open write stream to temp file
207 207
 
208 208
             // write
@@ -238,7 +238,7 @@  discard block
 block discarded – undo
238 238
         }
239 239
 
240 240
         return $this->respond('uploadComplete', [
241
-            'success' => (bool)$Media
241
+            'success' => (bool) $Media
242 242
             ,'data' => $Media,
243 243
         ]);
244 244
     }
@@ -260,9 +260,9 @@  discard block
 block discarded – undo
260 260
      */
261 261
     public function setCache(Response $response): Response
262 262
     {
263
-        $expires = 60*60*24*365;
263
+        $expires = 60 * 60 * 24 * 365;
264 264
         return $response->withHeader('Cache-Control', "public, max-age= $expires")
265
-        ->withHeader('Expires', gmdate('D, d M Y H:i:s \G\M\T', time()+$expires))
265
+        ->withHeader('Expires', gmdate('D, d M Y H:i:s \G\M\T', time() + $expires))
266 266
         ->withHeader('Pragma', 'public');
267 267
     }
268 268
 
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
         // if partial content provide proper response header
330 330
         if (isset($chunkStart)) {
331 331
             // only send 206 if response is less than the whole file
332
-            if ($end-$start+1<$size) {
332
+            if ($end - $start + 1 < $size) {
333 333
                 $response = $response->withStatus(206);
334 334
             }
335 335
             $response = $response->withHeader('Content-Range', "bytes $start-$end/$size")
Please login to merge, or discard this patch.
src/Responders/MediaBuilder.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@
 block discarded – undo
35 35
     public function getBody(): StreamInterface
36 36
     {
37 37
         $fp = new Stream(fopen($this->template, 'r'));
38
-        if (isset($this->start) && $this->start>0) {
38
+        if (isset($this->start) && $this->start > 0) {
39 39
             return new LimitStream($fp, $this->length, $this->start);
40 40
         }
41 41
         return $fp;
Please login to merge, or discard this patch.