Passed
Pull Request — master (#13)
by Iman
08:38
created
src/VideoStreamer.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -42,17 +42,17 @@  discard block
 block discarded – undo
42 42
     private function setHeader()
43 43
     {
44 44
         ob_get_clean();
45
-        header('Content-Type: '.$this->mime);
45
+        header('Content-Type: ' . $this->mime);
46 46
         header('Cache-Control: max-age=2592000, public');
47
-        header('Expires: '.gmdate('D, d M Y H:i:s', time() + 2592000).' GMT');
48
-        header('Last-Modified: '.gmdate('D, d M Y H:i:s', @filemtime($this->path)).' GMT');
47
+        header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 2592000) . ' GMT');
48
+        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', @filemtime($this->path)) . ' GMT');
49 49
         $this->start = 0;
50 50
         $this->size = filesize($this->path);
51 51
         $this->end = $this->size - 1;
52
-        header('Accept-Ranges: 0-'.$this->end);
52
+        header('Accept-Ranges: 0-' . $this->end);
53 53
 
54
-        if (! isset($_SERVER['HTTP_RANGE'])) {
55
-            header('Content-Length: '.$this->size);
54
+        if (!isset($_SERVER['HTTP_RANGE'])) {
55
+            header('Content-Length: ' . $this->size);
56 56
 
57 57
             return;
58 58
         }
@@ -88,8 +88,8 @@  discard block
 block discarded – undo
88 88
         $length = $this->end - $this->start + 1;
89 89
         fseek($this->stream, $this->start);
90 90
         header('HTTP/1.1 206 Partial Content');
91
-        header('Content-Length: '.$length);
92
-        header("Content-Range: bytes $this->start-$this->end/".$this->size);
91
+        header('Content-Length: ' . $length);
92
+        header("Content-Range: bytes $this->start-$this->end/" . $this->size);
93 93
     }
94 94
 
95 95
     /**
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
         $i = $this->start;
114 114
         set_time_limit(0);
115
-        while (! feof($this->stream) && $i <= $this->end) {
115
+        while (!feof($this->stream) && $i <= $this->end) {
116 116
             $this->video->setProgress($i);
117 117
 
118 118
             $bytesToRead = $this->buffer;
@@ -139,8 +139,8 @@  discard block
 block discarded – undo
139 139
     public static function streamFile($path)
140 140
     {
141 141
         $stream = fopen($path, 'rb');
142
-        if (! $stream) {
143
-            throw new \Exception('File not found in: '.$path, 6542);
142
+        if (!$stream) {
143
+            throw new \Exception('File not found in: ' . $path, 6542);
144 144
         }
145 145
 
146 146
         (new static($path, $stream))->start();
Please login to merge, or discard this patch.