...
 
Commits (2)
......@@ -43,7 +43,7 @@ class media implements Interfaces\Api, Interfaces\ApiIgnorePam
if (isset($pages[1]) && $pages[1] == 'play') {
http_response_code(302);
$res = !empty($_GET['res']) && in_array($_GET['res'], ['360', '720', '1080']) ?$_GET['res'] : '360';
$res = !empty($_GET['res']) && in_array($_GET['res'], ['360', '720', '1080'], true) ?$_GET['res'] : '360';
if ($entity->subtype == 'audio') {
\forward($entity->getSourceUrl('128.mp3'));
......
......@@ -29,7 +29,8 @@ class Manager
* @param bool $value
* @return Manager
*/
public function setFullHD(bool $value): Manager {
public function setFullHD(bool $value): Manager
{
$this->full_hd = $value;
return $this;
}
......
......@@ -91,7 +91,8 @@ class FFMpeg implements ServiceInterface
* @param bool $value
* @return FFMpeg
*/
public function setFullHD(bool $value) {
public function setFullHD(bool $value)
{
$this->full_hd = $value;
return $this;
}
......
......@@ -218,7 +218,7 @@ class Video extends Object
if ($field == 'access_id') {
$data[$field] = (int) $data[$field];
} elseif (in_array($field, ['mature', 'full_hd'])) {
} elseif (in_array($field, ['mature', 'full_hd'], true)) {
$this->setFlag($field, !!$data[$field]);
continue;
}
......
......@@ -58,7 +58,7 @@ class ManagerSpec extends ObjectBehavior
$lease->getGuid()
->willReturn(456);
$this->save->setEntity(Argument::that(function ($video) {
return $video->guid == 456
&& $video->access_id == 0;
......@@ -72,10 +72,14 @@ class ManagerSpec extends ObjectBehavior
$this->ffmpeg->setKey(456)
->shouldBeCalled();
$this->ffmpeg->setFullHD(false)
->shouldBeCalled();
$this->ffmpeg->transcode()
->shouldBeCalled();
$this->complete($lease)
$this->setFullHD(false)
->complete($lease)
->shouldReturn(true);
}
}