@@ -84,6 +84,6 @@ |
||
84 | 84 | */ |
85 | 85 | private function generateIV(): string |
86 | 86 | { |
87 | - return $this->openssl->reset()->addCommand(['rand', '-hex' ,'16'])->run(); |
|
87 | + return $this->openssl->reset()->addCommand(['rand', '-hex', '16'])->run(); |
|
88 | 88 | } |
89 | 89 | } |
90 | 90 | \ No newline at end of file |
@@ -72,7 +72,7 @@ |
||
72 | 72 | |
73 | 73 | $representations[] = $this->addRepresentation($kilobitrate, $width, $height); |
74 | 74 | |
75 | - $heights = array_filter($this->side_values, function ($value) use ($height) { |
|
75 | + $heights = array_filter($this->side_values, function($value) use ($height) { |
|
76 | 76 | return $value < $height; |
77 | 77 | }); |
78 | 78 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | */ |
29 | 29 | public function __construct(array $config) |
30 | 30 | { |
31 | - $this->s3 = new S3Client($config);; |
|
31 | + $this->s3 = new S3Client($config); ; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -40,7 +40,7 @@ |
||
40 | 40 | * @param string $method |
41 | 41 | * @param array $options |
42 | 42 | */ |
43 | - public function __construct(string $url, string $method = "GET", $options = []) |
|
43 | + public function __construct(string $url, string $method = "GET", $options = []) |
|
44 | 44 | { |
45 | 45 | $this->client = new Client(); |
46 | 46 | $this->url = $url; |
@@ -131,7 +131,9 @@ discard block |
||
131 | 131 | public static function moveDir(string $source, string $destination) |
132 | 132 | { |
133 | 133 | foreach (scandir($source) as $file) { |
134 | - if (in_array($file, [".", ".."])) continue; |
|
134 | + if (in_array($file, [".", ".."])) { |
|
135 | + continue; |
|
136 | + } |
|
135 | 137 | if (copy($source . $file, $destination . $file)) { |
136 | 138 | unlink($source . $file); |
137 | 139 | } |
@@ -153,7 +155,9 @@ discard block |
||
153 | 155 | } |
154 | 156 | |
155 | 157 | foreach (scandir($dir) as $item) { |
156 | - if (in_array($item, [".", ".."])) continue; |
|
158 | + if (in_array($item, [".", ".."])) { |
|
159 | + continue; |
|
160 | + } |
|
157 | 161 | if (!static::deleteDirectory($dir . DIRECTORY_SEPARATOR . $item)) { |
158 | 162 | return false; |
159 | 163 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | $streams = $media_info->all(); |
65 | 65 | |
66 | - foreach ($streams as $key => $stream){ |
|
66 | + foreach ($streams as $key => $stream) { |
|
67 | 67 | $streams[$key] = $stream->all(); |
68 | 68 | } |
69 | 69 | |
@@ -77,10 +77,10 @@ discard block |
||
77 | 77 | { |
78 | 78 | $metadata["qualities"] = $this->getQualities(); |
79 | 79 | |
80 | - $format_class = explode("\\" ,get_class($this->export->getFormat())); |
|
80 | + $format_class = explode("\\", get_class($this->export->getFormat())); |
|
81 | 81 | $metadata["format"] = end($format_class); |
82 | 82 | |
83 | - $export_class = explode("\\" ,get_class($this->export)); |
|
83 | + $export_class = explode("\\", get_class($this->export)); |
|
84 | 84 | $metadata["streaming_technique"] = end($export_class); |
85 | 85 | |
86 | 86 | if ($this->export instanceof DASH) { |
@@ -114,8 +114,8 @@ discard block |
||
114 | 114 | $metadata["dir_path_to_video"] = pathinfo($video_path)["dirname"]; |
115 | 115 | $metadata["basename_of_video"] = pathinfo($video_path)["basename"]; |
116 | 116 | $metadata["extension_of_video"] = pathinfo($video_path)["extension"]; |
117 | - $metadata["mime_content_type_of_video"] = !is_file($video_path)?:mime_content_type($video_path); |
|
118 | - $metadata["size_of_video"] = !is_file($video_path)?:filesize($video_path); |
|
117 | + $metadata["mime_content_type_of_video"] = !is_file($video_path) ?: mime_content_type($video_path); |
|
118 | + $metadata["size_of_video"] = !is_file($video_path) ?: filesize($video_path); |
|
119 | 119 | |
120 | 120 | $stream_path = $this->export->getPathInfo(); |
121 | 121 | $metadata["dir_path_to_stream"] = $stream_path["dirname"]; |
@@ -153,7 +153,7 @@ |
||
153 | 153 | * @return mixed |
154 | 154 | * @throws Exception |
155 | 155 | */ |
156 | - public function saveToS3(array $config, string $dest, string $path = null, bool $analyse =true) |
|
156 | + public function saveToS3(array $config, string $dest, string $path = null, bool $analyse = true) |
|
157 | 157 | { |
158 | 158 | list($results, $tmp_dir) = $this->saveToTemporaryFolder($path, $analyse); |
159 | 159 | sleep(1); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | $streams = $media_info["media"]["track"]; |
33 | 33 | $stream_collection = []; |
34 | 34 | |
35 | - foreach ($streams as $stream){ |
|
35 | + foreach ($streams as $stream) { |
|
36 | 36 | $stream_collection[] = new Stream($stream); |
37 | 37 | } |
38 | 38 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function audios() |
40 | 40 | { |
41 | - $audios = array_filter($this->streams, function (Stream $stream) { |
|
41 | + $audios = array_filter($this->streams, function(Stream $stream) { |
|
42 | 42 | return $stream->isAudio(); |
43 | 43 | }); |
44 | 44 | |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function videos() |
52 | 52 | { |
53 | - $videos = array_filter($this->streams, function (Stream $stream) { |
|
53 | + $videos = array_filter($this->streams, function(Stream $stream) { |
|
54 | 54 | return $stream->isVideo(); |
55 | 55 | }); |
56 | 56 | |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function general() |
64 | 64 | { |
65 | - foreach ($this->streams as $stream){ |
|
66 | - if ($stream instanceof Stream && $stream->get('@type') === "General"){ |
|
65 | + foreach ($this->streams as $stream) { |
|
66 | + if ($stream instanceof Stream && $stream->get('@type') === "General") { |
|
67 | 67 | return $stream; |
68 | 68 | } |
69 | 69 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $attr = array($attr); |
39 | 39 | } |
40 | 40 | |
41 | - $out = array_filter($this->stream, function ($key) use ($attr) { |
|
41 | + $out = array_filter($this->stream, function($key) use ($attr) { |
|
42 | 42 | return in_array($key, $attr) || current($attr) === "*"; |
43 | 43 | }, ARRAY_FILTER_USE_KEY); |
44 | 44 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | $attr = array($attr); |
57 | 57 | } |
58 | 58 | |
59 | - $out = array_filter($this->stream, function ($key) use ($attr) { |
|
59 | + $out = array_filter($this->stream, function($key) use ($attr) { |
|
60 | 60 | return !in_array($key, $attr); |
61 | 61 | }, ARRAY_FILTER_USE_KEY); |
62 | 62 |