Passed
Push — master ( 7da7e7...0b144b )
by Amin
02:49
created
src/File.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -42,7 +42,9 @@
 block discarded – undo
42 42
         if (is_dir($dir)) {
43 43
             $size = 0;
44 44
             foreach (scandir($dir) as $file) {
45
-                if (in_array($file, [".", ".."])) continue;
45
+                if (in_array($file, [".", ".."])) {
46
+                    continue;
47
+                }
46 48
                 $filename = $dir . DIRECTORY_SEPARATOR . $file;
47 49
                 $size += is_file($filename) ? filesize($filename) : static::directorySize($filename);
48 50
             }
Please login to merge, or discard this patch.
src/Clouds/MicrosoftAzure.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      */
30 30
     public function __construct($connection, array $options = [])
31 31
     {
32
-        if(!class_exists('\MicrosoftAzure\Storage\Blob\BlobRestProxy')){
32
+        if (!class_exists('\MicrosoftAzure\Storage\Blob\BlobRestProxy')) {
33 33
             throw new RuntimeException('MicrosoftAzure\Storage\Blob\BlobRestProxy not found. make sure the package is installed: composer require microsoft/azure-storage-blob');
34 34
         }
35 35
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
      */
44 44
     public function uploadDirectory(string $dir, array $options): void
45 45
     {
46
-        if(!isset($options['container'])){
46
+        if (!isset($options['container'])) {
47 47
             throw new InvalidArgumentException("You should set the container in the array");
48 48
         }
49 49
 
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      */
68 68
     public function download(string $save_to, array $options): void
69 69
     {
70
-        if(!isset($options['container']) ||  !isset($options['blob'])){
70
+        if (!isset($options['container']) || !isset($options['blob'])) {
71 71
             throw new InvalidArgumentException("You should set the container and blob in the array");
72 72
         }
73 73
 
Please login to merge, or discard this patch.
src/Clouds/S3.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function __construct(array $config)
30 30
     {
31
-        if(!class_exists('\Aws\S3\S3Client')){
31
+        if (!class_exists('\Aws\S3\S3Client')) {
32 32
             throw new RuntimeException('Aws\S3\S3Client not found. make sure the package is installed: composer require aws/aws-sdk-php');
33 33
         }
34 34
 
35
-        $this->s3 = new \Aws\S3\S3Client($config);;
35
+        $this->s3 = new \Aws\S3\S3Client($config); ;
36 36
     }
37 37
 
38 38
     /**
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     public function uploadDirectory(string $dir, array $options): void
43 43
     {
44
-        if(!isset($options['dest'])){
44
+        if (!isset($options['dest'])) {
45 45
             throw new InvalidArgumentException("You should set the dest in the array");
46 46
         }
47 47
         $dest = $options['dest'];
Please login to merge, or discard this patch.
src/Clouds/GoogleCloudStorage.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
      */
24 24
     public function __construct(array $config)
25 25
     {
26
-        if(!class_exists('\Google\Cloud\Storage\StorageClient')){
26
+        if (!class_exists('\Google\Cloud\Storage\StorageClient')) {
27 27
             throw new RuntimeException('Google\Cloud\Storage\StorageClient not found. make sure the package is installed: composer require google/cloud-storage');
28 28
         }
29 29
 
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
     {
65 65
         $bucket = $this->getBucket($options);
66 66
 
67
-        if(!isset($options['bucket'])){
67
+        if (!isset($options['bucket'])) {
68 68
             throw new InvalidArgumentException("You need to set the bucket name in the option array");
69 69
         }
70 70
         $name = $options['object_name'];
@@ -83,12 +83,12 @@  discard block
 block discarded – undo
83 83
      */
84 84
     private function getBucket(array $options): \Google\Cloud\Storage\Bucket
85 85
     {
86
-        if(!isset($options['bucket'])){
86
+        if (!isset($options['bucket'])) {
87 87
             throw new InvalidArgumentException("You need to set the bucket name in the option array");
88 88
         }
89
-        try{
89
+        try {
90 90
             return $this->storage->bucket($options['bucket'], $options['user_project'] ?? false);
91
-        }catch (\Exception $e){
91
+        } catch (\Exception $e) {
92 92
             throw new RuntimeException(sprintf("An error occurred while opening the bucket: %s", $e->getMessage()), $e->getCode(), $e);
93 93
         }
94 94
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
         }
89 89
         try{
90 90
             return $this->storage->bucket($options['bucket'], $options['user_project'] ?? false);
91
-        }catch (\Exception $e){
91
+        } catch (\Exception $e){
92 92
             throw new RuntimeException(sprintf("An error occurred while opening the bucket: %s", $e->getMessage()), $e->getCode(), $e);
93 93
         }
94 94
     }
Please login to merge, or discard this patch.
src/HLSKeyInfo.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -170,7 +170,7 @@
 block discarded – undo
170 170
      */
171 171
     private function call(string $needle, int $period): callable
172 172
     {
173
-        return function ($line) use ($needle, $period) {
173
+        return function($line) use ($needle, $period) {
174 174
             if (false !== strpos($line, $needle) && !in_array($line, $this->segments)) {
175 175
                 array_push($this->segments, $line);
176 176
                 if (0 === count($this->segments) % $period) {
Please login to merge, or discard this patch.
src/AutoReps.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -174,7 +174,7 @@
 block discarded – undo
174 174
      */
175 175
     private function sortReps(array &$reps): void
176 176
     {
177
-        usort($reps, function (Representation $rep1, Representation $rep2) {
177
+        usort($reps, function(Representation $rep1, Representation $rep2) {
178 178
             $ascending = $rep1->getKiloBitrate() > $rep2->getKiloBitrate();
179 179
             return $this->sort ? $ascending : !$ascending;
180 180
         });
Please login to merge, or discard this patch.
src/Filters/HLSFilter.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
      */
94 94
     private function getInitFilename(Representation $rep): string
95 95
     {
96
-        return $this->seg_sub_dir . $this->filename . "_" . $rep->getHeight() ."p_". $this->hls->getHlsFmp4InitFilename();
96
+        return $this->seg_sub_dir . $this->filename . "_" . $rep->getHeight() . "p_" . $this->hls->getHlsFmp4InitFilename();
97 97
     }
98 98
 
99 99
     /**
Please login to merge, or discard this patch.
src/Utiles.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
      */
31 31
     public static function concatKeyValue(array &$array, string $glue = ""): void
32 32
     {
33
-        array_walk($array, function (&$value, $key) use ($glue) {
33
+        array_walk($array, function(&$value, $key) use ($glue) {
34 34
             $value = "$key$glue$value";
35 35
         });
36 36
     }
@@ -44,9 +44,9 @@  discard block
 block discarded – undo
44 44
     {
45 45
         $new = [];
46 46
         foreach ($array as $key => $value) {
47
-            if(is_string($key)){
47
+            if (is_string($key)) {
48 48
                 array_push($new, $start_with . $key, $value);
49
-            }else{
49
+            } else {
50 50
                 $new = null;
51 51
                 break;
52 52
             }
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
         foreach ($array as $key => $value) {
47 47
             if(is_string($key)){
48 48
                 array_push($new, $start_with . $key, $value);
49
-            }else{
49
+            } else{
50 50
                 $new = null;
51 51
                 break;
52 52
             }
Please login to merge, or discard this patch.
src/HLSSubtitle.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $this->language_name = $language_name;
66 66
         $this->language_code = $language_code;
67 67
 
68
-        if(!in_array(pathinfo($path, PATHINFO_EXTENSION), static::SUPPORTED_EXTS)){
68
+        if (!in_array(pathinfo($path, PATHINFO_EXTENSION), static::SUPPORTED_EXTS)) {
69 69
             throw new InvalidArgumentException(sprintf("Unsupported input! Only %s files are acceptable.", implode(",", static::SUPPORTED_EXTS)));
70 70
         }
71 71
     }
@@ -245,7 +245,7 @@  discard block
 block discarded – undo
245 245
             "AUTOSELECT"    => Utiles::convertBooleanToYesNo($this->isAutoSelect()),
246 246
             "FORCED"        => Utiles::convertBooleanToYesNo($this->isForce()),
247 247
             "LANGUAGE"      => "\"" . $this->language_code . "\"",
248
-            "URI"           => "\"" . $this->getM3u8Uri(). "\"",
248
+            "URI"           => "\"" . $this->getM3u8Uri() . "\"",
249 249
         ];
250 250
         Utiles::concatKeyValue($ext, "=");
251 251
 
@@ -265,11 +265,11 @@  discard block
 block discarded – undo
265 265
         Utiles::concatKeyValue($ext_x, ":");
266 266
         File::put($path, implode(PHP_EOL, array_merge([static::S_TAG], $ext_x, [$this->getUri(), static::E_TAG])));
267 267
 
268
-        if(!$this->m3u8_uri){
268
+        if (!$this->m3u8_uri) {
269 269
             $this->setM3u8Uri(pathinfo($path, PATHINFO_BASENAME));
270 270
         }
271 271
 
272
-        if(!$this->uri){
272
+        if (!$this->uri) {
273 273
             File::copy($this->path, implode(DIRECTORY_SEPARATOR, [dirname($path), $this->getBaseName()]));
274 274
         }
275 275
     }
Please login to merge, or discard this patch.