diff --git a/classes/Config.php b/classes/Config.php index cf55404..46b2340 100644 --- a/classes/Config.php +++ b/classes/Config.php @@ -16,7 +16,7 @@ class Config /** * Singleton instance. * - * @var Config + * @var Config|null */ private static $instance; @@ -133,11 +133,9 @@ class Config */ public function __construct(array $options) { - if (isset($options) && is_array($options)) { - foreach ($options as $option => $value) { - if (isset($this->$option) && isset($value)) { - $this->$option = $value; - } + foreach ($options as $option => $value) { + if (isset($this->$option) && isset($value)) { + $this->$option = $value; } } $this->getEnv(); diff --git a/classes/LocaleManager.php b/classes/LocaleManager.php index cbc1ddd..af714ba 100644 --- a/classes/LocaleManager.php +++ b/classes/LocaleManager.php @@ -24,7 +24,7 @@ class LocaleManager /** * Current locale. * - * @var Locale + * @var Locale|null */ private $curLocale; @@ -78,7 +78,7 @@ class LocaleManager /** * Get the current locale. * - * @return Locale + * @return Locale|null */ public function getLocale() { diff --git a/classes/LocaleMiddleware.php b/classes/LocaleMiddleware.php index 51dfe6e..9aeb81e 100644 --- a/classes/LocaleMiddleware.php +++ b/classes/LocaleMiddleware.php @@ -37,7 +37,7 @@ class LocaleMiddleware * * @param array $proposedLocale Locale array created by AcceptLanguage::parse() * - * @return string Locale name if chosen, nothing otherwise + * @return Locale Locale if chosen, nothing otherwise */ public function testLocale(array $proposedLocale) { @@ -65,7 +65,7 @@ class LocaleMiddleware { $headers = $request->getHeader('Accept-Language'); $curLocale = $this->localeManager->getLocale(); - if (!isset($curLocale)) { + if (is_null($curLocale)) { if (isset($headers[0])) { $this->localeManager->setLocale( AcceptLanguage::detect([$this, 'testLocale'], new Locale('en_US'), $headers[0]) diff --git a/classes/PlaylistArchiveStream.php b/classes/PlaylistArchiveStream.php index 56d32d2..8ee5d14 100644 --- a/classes/PlaylistArchiveStream.php +++ b/classes/PlaylistArchiveStream.php @@ -186,7 +186,7 @@ class PlaylistArchiveStream extends TarArchive public function stream_read($count) { if (!$this->files[$this->curFile]['headersSent']) { - $urls = $this->download->getUrl($this->files[$this->curFile]['url'], $this->format); + $urls = $this->download->getURL($this->files[$this->curFile]['url'], $this->format); $response = $this->client->request('GET', $urls[0], ['stream' => true]); $contentLengthHeaders = $response->getHeader('Content-Length'); diff --git a/classes/VideoDownload.php b/classes/VideoDownload.php index 0f3c462..539462a 100644 --- a/classes/VideoDownload.php +++ b/classes/VideoDownload.php @@ -130,7 +130,7 @@ class VideoDownload * @param string $format Format to use for the video * @param string $password Video password * - * @return object Decoded JSON + * @return stdClass Decoded JSON * */ public function getJSON($url, $format = null, $password = null) { @@ -214,7 +214,7 @@ class VideoDownload /** * Return arguments used to run rtmp for a specific video. * - * @param object $video Video object returned by youtube-dl + * @param stdClass $video Video object returned by youtube-dl * * @return array Arguments */ @@ -266,12 +266,12 @@ class VideoDownload /** * Get a process that runs avconv in order to convert a video. * - * @param object $video Video object returned by youtube-dl - * @param int $audioBitrate Audio bitrate of the converted file - * @param string $filetype Filetype of the converted file - * @param bool $audioOnly True to return an audio-only file - * @param string $from Start the conversion at this time - * @param string $to End the conversion at this time + * @param stdClass $video Video object returned by youtube-dl + * @param int $audioBitrate Audio bitrate of the converted file + * @param string $filetype Filetype of the converted file + * @param bool $audioOnly True to return an audio-only file + * @param string $from Start the conversion at this time + * @param string $to End the conversion at this time * * @throws Exception If avconv/ffmpeg is missing * @@ -484,8 +484,8 @@ class VideoDownload /** * Get a Tar stream containing every video in the playlist piped through the server. * - * @param object $video Video object returned by youtube-dl - * @param string $format Requested format + * @param stdClass $video Video object returned by youtube-dl + * @param string $format Requested format * * @throws Exception If the popen stream was not created correctly *