diff --git a/Blacklight/AniDB.php b/Blacklight/AniDB.php index c9874a347..370d09a5f 100755 --- a/Blacklight/AniDB.php +++ b/Blacklight/AniDB.php @@ -101,10 +101,11 @@ class AniDB /** * Retrieves a list of Anime titles, optionally filtered by starting character and title. * + * * @param string $letter * @param string $animetitle - * @return array|bool - * @throws \RuntimeException + * + * @return array */ public function getAnimeList($letter = '', $animetitle = '') { diff --git a/Blacklight/Console.php b/Blacklight/Console.php index 67e1dacc7..83d49a6de 100755 --- a/Blacklight/Console.php +++ b/Blacklight/Console.php @@ -863,7 +863,7 @@ class Console /** * @param $releasename * - * @return array|bool + * @return array|false */ public function parseTitle($releasename) { @@ -910,10 +910,8 @@ class Console $platform = 'PSX'; } - if (! empty($title) && stripos('XBLA', $platform) === 0) { - if (stripos('dlc', $title) !== false) { - $platform = 'XBOX360'; - } + if (! empty($title) && stripos('XBLA', $platform) === 0 && stripos('dlc', $title) !== false) { + $platform = 'XBOX360'; } $browseNode = $this->getBrowseNode($platform); @@ -927,7 +925,7 @@ class Console Other option is to pass the $release->categories_id here if we don't find a platform but that would require an extra lookup to determine the name. In either case we should have a title at the minimum. */ - return (isset($result['title']) && ! empty($result['title']) && isset($result['platform'])) ? $result : false; + return (isset($result['title'], $result['platform']) && ! empty($result['title'])) ? $result : false; } /** diff --git a/Blacklight/Contents.php b/Blacklight/Contents.php index 724b651c0..b04f3116a 100755 --- a/Blacklight/Contents.php +++ b/Blacklight/Contents.php @@ -19,7 +19,7 @@ class Contents } /** - * @return array|bool + * @return array|false */ public function get() { @@ -37,7 +37,7 @@ class Contents } /** - * @return array|bool + * @return array|false */ public function getAll() { @@ -57,7 +57,7 @@ class Contents /** * Convert get all but from to object. * - * @return array|bool + * @return array|false */ public function getAllButFront() { @@ -75,7 +75,7 @@ class Contents } /** - * @return array|bool + * @return array|false */ public function getFrontPage() { @@ -96,7 +96,7 @@ class Contents * @param $id * @param $role * - * @return array|bool + * @return array|false */ public function getForMenuByTypeAndRole($id, $role) { diff --git a/Blacklight/CouchPotato.php b/Blacklight/CouchPotato.php index 1781f3960..671283fff 100755 --- a/Blacklight/CouchPotato.php +++ b/Blacklight/CouchPotato.php @@ -30,13 +30,13 @@ class CouchPotato { /** * URL to the CP server. - * @var string|array|bool + * @var string */ public $cpurl = ''; /** * The CP key. - * @var string|array|bool + * @var string */ public $cpapi = ''; diff --git a/Blacklight/Games.php b/Blacklight/Games.php index 9a8f744f7..1b6686e38 100755 --- a/Blacklight/Games.php +++ b/Blacklight/Games.php @@ -48,7 +48,7 @@ class Games public $maxHitRequest; /** - * @var array|bool|string + * @var null|string */ public $publicKey; @@ -57,11 +57,6 @@ class Games */ public $renamed; - /** - * @var array|bool|int|string - */ - public $sleepTime; - /** * @var string */ @@ -73,7 +68,7 @@ class Games protected $_gameID; /** - * @var array|bool + * @var array|false */ protected $_gameResults; @@ -88,7 +83,7 @@ class Games protected $_resultsFound = 0; /** - * @var array|bool|int|string + * @var string */ public $catWhere; @@ -153,7 +148,7 @@ class Games /** * @param string $title * - * @return array|bool + * @return array|false */ public function getGamesInfoByName($title) { @@ -770,7 +765,7 @@ class Games * * @param string $releaseName * - * @return array|bool + * @return array|false */ public function parseTitle($releaseName) { diff --git a/Blacklight/Genres.php b/Blacklight/Genres.php index 6dae03c61..462ede02c 100755 --- a/Blacklight/Genres.php +++ b/Blacklight/Genres.php @@ -30,12 +30,13 @@ class Genres /** * @param string $type - * @param bool $activeonly - * @return array|bool + * @param bool $activeOnly + * + * @return array|mixed */ - public function getGenres($type = '', $activeonly = false) + public function getGenres($type = '', $activeOnly = false) { - $sql = $this->getListQuery($type, $activeonly); + $sql = $this->getListQuery($type, $activeOnly); $genres = Cache::get(md5($sql)); if ($genres !== null) { return $genres; @@ -65,10 +66,10 @@ class Genres /** * @param string $type - * @param bool $activeonly + * @param bool $activeOnly * @return string */ - private function getListQuery($type = '', $activeonly = false): string + private function getListQuery($type = '', $activeOnly = false): string { if (! empty($type)) { $typesql = sprintf(' AND g.type = %d', $type); @@ -76,7 +77,7 @@ class Genres $typesql = ''; } - if ($activeonly) { + if ($activeOnly) { $sql = sprintf( ' SELECT g.* @@ -108,14 +109,15 @@ class Genres /** * @param string $type - * @param bool $activeonly - * @param $start - * @param $num - * @return array|bool + * @param bool $activeOnly + * @param int $start + * @param int $num + * + * @return array */ - public function getRange($type = '', $activeonly = false, $start, $num) + public function getRange($type = '', $activeOnly = false, $start, $num): array { - $sql = $this->getListQuery($type, $activeonly); + $sql = $this->getListQuery($type, $activeOnly); $sql .= ' LIMIT '.$num.' OFFSET '.$start; return (array) array_first(DB::select($sql)); @@ -123,10 +125,10 @@ class Genres /** * @param string $type - * @param bool $activeonly + * @param bool $activeOnly * @return mixed */ - public function getCount($type = '', $activeonly = false) + public function getCount($type = '', $activeOnly = false) { if (! empty($type)) { $typesql = sprintf(' AND g.type = %d', $type); @@ -134,7 +136,7 @@ class Genres $typesql = ''; } - if ($activeonly) { + if ($activeOnly) { $sql = sprintf( ' SELECT COUNT(id) AS num diff --git a/Blacklight/IRCScraper.php b/Blacklight/IRCScraper.php index 68f925d2a..a687fd796 100755 --- a/Blacklight/IRCScraper.php +++ b/Blacklight/IRCScraper.php @@ -43,8 +43,7 @@ class IRCScraper extends IRCClient protected $_nuked; /** - * Array of old pre info. - * @var array|bool + * @var */ protected $_oldPre; diff --git a/Blacklight/Movie.php b/Blacklight/Movie.php index cae3e18d8..c3d06b748 100755 --- a/Blacklight/Movie.php +++ b/Blacklight/Movie.php @@ -102,7 +102,7 @@ class Movie public $imdburl; /** - * @var array|bool|int|string + * @var int */ public $movieqty; @@ -225,7 +225,8 @@ class Movie /** * @param $imdbId - * @return array|bool|\Illuminate\Database\Eloquent\Model|null|static + * + * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|null|object */ public function getMovieInfo($imdbId) { @@ -244,7 +245,7 @@ class Movie * @param int $maxAge * @param array $excludedCats * - * @return array|bool + * @return array|mixed */ public function getMovieRange($page, $cat, $start, $num, $orderBy, $maxAge = -1, array $excludedCats = []) { @@ -744,7 +745,7 @@ class Movie * * @param $imdbId * - * @return bool|array + * @return array|false */ protected function fetchFanartTVProperties($imdbId) { @@ -792,7 +793,7 @@ class Movie * @param $imdbId * @param bool $text * - * @return array|bool + * @return array|false */ public function fetchTMDBProperties($imdbId, $text = false) { @@ -888,7 +889,7 @@ class Movie /** * @param $imdbId * - * @return array|bool + * @return array|false */ public function fetchIMDBProperties($imdbId) { @@ -931,7 +932,7 @@ class Movie * * @param $imdbId * - * @return bool|array + * @return array|false * @throws \Exception */ public function fetchTraktTVProperties($imdbId) @@ -977,7 +978,7 @@ class Movie * * @param $imdbId * - * @return bool|array + * @return array|false */ public function fetchOmdbAPIProperties($imdbId) { @@ -1214,7 +1215,7 @@ class Movie } /** - * @return bool|mixed + * @return mixed|false */ protected function localIMDBSearch() { diff --git a/Blacklight/Music.php b/Blacklight/Music.php index 77697dc21..06fe4985b 100755 --- a/Blacklight/Music.php +++ b/Blacklight/Music.php @@ -34,27 +34,27 @@ class Music public $echooutput; /** - * @var array|bool|string + * @var null|string */ public $pubkey; /** - * @var array|bool|string + * @var null|string */ public $privkey; /** - * @var array|bool|string + * @var null|string */ public $asstag; /** - * @var array|bool|int|string + * @var int */ public $musicqty; /** - * @var array|bool|int|string + * @var int */ public $sleeptime; @@ -706,13 +706,13 @@ class Music } /** - * @param $releasename + * @param string $releaseName * - * @return array|bool + * @return array|false */ - public function parseArtist($releasename) + public function parseArtist($releaseName) { - if (preg_match('/(.+?)(\d{1,2} \d{1,2} )?\(?(19\d{2}|20[0-1][\d])\b/', $releasename, $name)) { + if (preg_match('/(.+?)(\d{1,2} \d{1,2} )?\(?(19\d{2}|20[0-1][\d])\b/', $releaseName, $name)) { $result = []; $result['year'] = $name[3]; @@ -730,12 +730,12 @@ class Music $result['name'] = $newname; return $result; - } else { - return false; } - } else { + return false; } + + return false; } /** diff --git a/Blacklight/NZBContents.php b/Blacklight/NZBContents.php index 4fb970b69..193627f2c 100755 --- a/Blacklight/NZBContents.php +++ b/Blacklight/NZBContents.php @@ -145,7 +145,7 @@ class NZBContents * @param $relID * @param $groupID * @param bool $nfoCheck - * @return array|bool + * @return array|false * @throws \Exception */ public function parseNZB($guid, $relID, $groupID, $nfoCheck = false) diff --git a/Blacklight/NZBGet.php b/Blacklight/NZBGet.php index 2e3434d1a..f270b3819 100755 --- a/Blacklight/NZBGet.php +++ b/Blacklight/NZBGet.php @@ -349,8 +349,8 @@ class NZBGet /** * Get all items in download queue. * - * @return array|bool - * @throws \RuntimeException + * + * @return array|false */ public function getQueue() { @@ -380,7 +380,7 @@ class NZBGet /** * Request for current status (summary) information. Parts of informations returned by this method can be printed by command "nzbget -L". * - * @return array|bool The status. + * @return array|false The status. * @throws \RuntimeException */ public function status() diff --git a/Blacklight/NZBVortex.php b/Blacklight/NZBVortex.php index 2e0392f7f..62a5df978 100755 --- a/Blacklight/NZBVortex.php +++ b/Blacklight/NZBVortex.php @@ -214,7 +214,7 @@ final class NZBVortex * get filelist for nzb. * * @param int $id - * @return array|bool + * @return array|false * @throws \Exception */ public function getFilelist($id = 0) @@ -222,9 +222,8 @@ final class NZBVortex if ($id > 0) { // file/(nzbid) $params = ['sessionid' => $this->session]; - $response = $this->sendRequest(sprintf('file/%s', $id), $params); - return $response; + return $this->sendRequest(sprintf('file/%s', $id), $params); } return false; diff --git a/Blacklight/NameFixer.php b/Blacklight/NameFixer.php index 5ac243fad..570ffb2fe 100755 --- a/Blacklight/NameFixer.php +++ b/Blacklight/NameFixer.php @@ -740,7 +740,7 @@ class NameFixer * @param $query * @param string $limit * - * @return array|bool + * @return array|false */ protected function _getReleases($time, $cats, $query, $limit = '') { diff --git a/Blacklight/Nfo.php b/Blacklight/Nfo.php index 9f3a9e1cc..c7fc02c42 100755 --- a/Blacklight/Nfo.php +++ b/Blacklight/Nfo.php @@ -78,7 +78,7 @@ class Nfo * * @param string $str The string with a Show ID. * - * @return array|bool Return array with show ID and site source or false on failure. + * @return array|false Return array with show ID and site source or false on failure. */ public function parseShowId($str) { diff --git a/Blacklight/ReleaseCleaning.php b/Blacklight/ReleaseCleaning.php index 613e1042a..2e3e28ed3 100755 --- a/Blacklight/ReleaseCleaning.php +++ b/Blacklight/ReleaseCleaning.php @@ -93,7 +93,7 @@ class ReleaseCleaning * @param $groupName * @param bool $usePre * - * @return array|bool|null + * @return array|false|string * @throws \Exception */ public function releaseCleaner($subject, $fromName, $groupName, $usePre = false) diff --git a/Blacklight/ReleaseExtra.php b/Blacklight/ReleaseExtra.php index b12bc444c..f6661a1d8 100755 --- a/Blacklight/ReleaseExtra.php +++ b/Blacklight/ReleaseExtra.php @@ -76,7 +76,7 @@ class ReleaseExtra /** * @param $id - * @return array|bool + * @return array|false */ public function getVideo($id) { @@ -91,7 +91,7 @@ class ReleaseExtra /** * @param $id - * @return array|bool + * @return array|false */ public function getAudio($id) { @@ -119,11 +119,11 @@ class ReleaseExtra } /** - * @param $guid + * @param string $guid * - * @return array|bool + * @return array */ - public function getBriefByGuid($guid) + public function getBriefByGuid($guid): array { return DB::select( sprintf( diff --git a/Blacklight/SABnzbd.php b/Blacklight/SABnzbd.php index 500a95142..9ea8fa98b 100755 --- a/Blacklight/SABnzbd.php +++ b/Blacklight/SABnzbd.php @@ -32,26 +32,22 @@ class SABnzbd public const PRIORITY_FORCE = 2; // Sab is enabled, 1 remote SAB server for the whole site. /** - * URL to the SAB server. - * @var string|array|bool + * @var string */ public $url = ''; /** - * The SAB API key. - * @var string|array|bool + * @var string */ public $apikey = ''; /** - * Download priority of the sent NZB file. - * @var string|array|bool + * @var string */ public $priority = ''; /** - * Type of SAB API key (full/nzb). - * @var string|array|bool + * @var string */ public $apikeytype = ''; diff --git a/Blacklight/Sharing.php b/Blacklight/Sharing.php index 72a11cc01..36e14affc 100755 --- a/Blacklight/Sharing.php +++ b/Blacklight/Sharing.php @@ -140,9 +140,10 @@ class Sharing /** * Initialise of reset sharing settings. * + * * @param string $siteGuid Optional hash (must be sha1) we can set the site guid to. * - * @return array|bool + * @return mixed */ public function initSettings(&$siteGuid = '') { diff --git a/Blacklight/Steam.php b/Blacklight/Steam.php index a1f30b7bd..15d87376b 100755 --- a/Blacklight/Steam.php +++ b/Blacklight/Steam.php @@ -54,7 +54,7 @@ class Steam * * @param int $appID * - * @return array|bool + * @return array|false */ public function getAll($appID) { diff --git a/Blacklight/XXX.php b/Blacklight/XXX.php index b7e13572b..9a1079a47 100755 --- a/Blacklight/XXX.php +++ b/Blacklight/XXX.php @@ -49,11 +49,6 @@ class XXX */ protected $releaseImage; - /** - * @var - */ - protected $currentRelID; - /** * @var int|null|string */ @@ -64,13 +59,15 @@ class XXX */ protected $showPasswords; + /** + * @var string + * + */ protected $cookie; /** - * @var array|bool|int|string + * @var \PDO */ - public $catWhere; - protected $pdo; /** @@ -664,7 +661,6 @@ class XXX if ($this->parseXXXSearchName($arr['searchname']) !== false) { $check = $this->checkXXXInfoExists($this->currentTitle); if ($check === null) { - $this->currentRelID = $arr['id']; if ($this->echooutput) { ColorCLI::doEcho(ColorCLI::primaryOver('Looking up: ').ColorCLI::headerOver($this->currentTitle), true); } diff --git a/Blacklight/db/DB.php b/Blacklight/db/DB.php old mode 100755 new mode 100644 diff --git a/Blacklight/db/populate/AniDB.php b/Blacklight/db/populate/AniDB.php index 396abc1ce..e2777b6a8 100755 --- a/Blacklight/db/populate/AniDB.php +++ b/Blacklight/db/populate/AniDB.php @@ -97,14 +97,12 @@ class AniDB } /** - * Checks for an existing anime title in anidb table. + * @param $id + * @param $type + * @param $lang + * @param $title * - * @param int $id The AniDB ID to be inserted - * @param string $type The title type - * @param string $lang The title language - * @param string $title The title of the Anime - * - * @return array|bool + * @return array */ private function checkDuplicateDbEntry($id, $type, $lang, $title) { @@ -112,12 +110,9 @@ class AniDB } /** - * Retrieves supplemental anime info from the AniDB API. - * * @param $anidbId * - * @return array|bool - * @throws \Exception + * @return array|false */ private function getAniDbAPI($anidbId) { diff --git a/Blacklight/libraries/Cache.php b/Blacklight/libraries/Cache.php deleted file mode 100755 index 15ecc4bed..000000000 --- a/Blacklight/libraries/Cache.php +++ /dev/null @@ -1,390 +0,0 @@ -ping()) { - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - case self::TYPE_MEMCACHED: - return $this->server->set($key, $data, $expiration); - case self::TYPE_APC: - return apc_add($key, $data, $expiration); - } - } - - return false; - } - - /** - * Attempt to retrieve a value from the cache server, if not set it. - * - * - * @param $key - * @return bool|mixed|string - * @throws \Blacklight\libraries\CacheException - */ - public function get($key) - { - if ($this->ping()) { - $data = ''; - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - case self::TYPE_MEMCACHED: - $data = $this->server->get($key); - break; - case self::TYPE_APC: - $data = apc_fetch($key); - break; - } - - return $data; - } - - return false; - } - - /** - * Delete data tied to a key on the cache server. - * - * - * @param $key - * @return bool|string[] - * @throws \Blacklight\libraries\CacheException - */ - public function delete($key) - { - if ($this->ping()) { - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - case self::TYPE_MEMCACHED: - return (bool) $this->server->delete($key); - case self::TYPE_APC: - return apc_delete($key); - } - } - - return false; - } - - /** - * Flush all data from the cache server? - * - * - * @throws \Blacklight\libraries\CacheException - */ - public function flush() - { - if ($this->ping()) { - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - $this->server->flushAll(); - break; - case self::TYPE_MEMCACHED: - $this->server->flush(); - break; - case self::TYPE_APC: - apc_clear_cache('user'); - apc_clear_cache(); - break; - } - } - } - - /** - * Create a SHA1 hash from a string which can be used to store/retrieve data. - * - * @param string $string - * - * @return string SHA1 hash of the input string. - */ - public function createKey($string) - { - return sha1($string); - } - - /** - * Get cache server statistics. - * - * - * @return array|bool - * @throws \Blacklight\libraries\CacheException - */ - public function serverStatistics() - { - if ($this->ping()) { - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - return $this->server->info(); - case self::TYPE_MEMCACHED: - return $this->server->getStats(); - case self::TYPE_APC: - return apc_cache_info(); - } - } - - return []; - } - - /** - * Verify the user's cache settings, try to connect to the cache server. - * - * @throws \Blacklight\libraries\CacheException - */ - public function __construct() - { - if (! \defined('NN_CACHE_HOSTS')) { - throw new CacheException( - 'The NN_CACHE_HOSTS is not defined! Define it in settings.php' - ); - } - - if (! \defined('NN_CACHE_TIMEOUT')) { - throw new CacheException( - 'The NN_CACHE_TIMEOUT is not defined! Define it in settings.php, it is the time in seconds to time out from your cache server.' - ); - } - - $this->socketFile = false; - if (\defined('NN_CACHE_SOCKET_FILE') && NN_CACHE_SOCKET_FILE != '') { - $this->socketFile = true; - } - - $serializer = false; - if (\defined('NN_CACHE_SERIALIZER')) { - $serializer = true; - } - - switch (NN_CACHE_TYPE) { - - case self::TYPE_REDIS: - if (! \extension_loaded('redis')) { - throw new CacheException('The redis extension is not loaded!'); - } - $this->server = new \Redis(); - $this->connect(); - if ($serializer) { - $this->server->setOption(\Redis::OPT_SERIALIZER, $this->verifySerializer()); - } - break; - - case self::TYPE_MEMCACHED: - if (! \extension_loaded('memcached')) { - throw new CacheException('The memcached extension is not loaded!'); - } - $this->server = new \Memcached(); - if ($serializer) { - $this->server->setOption(\Memcached::OPT_SERIALIZER, $this->verifySerializer()); - } - $this->server->setOption(\Memcached::OPT_COMPRESSION, (defined('NN_CACHE_COMPRESSION') ? NN_CACHE_COMPRESSION : false)); - $this->connect(); - break; - - case self::TYPE_APC: - // Faster than checking if apcu or apc is loaded. - if (! \function_exists('apc_add')) { - throw new CacheException('The APCu extension is not loaded or enabled!'); - } - $this->connect(); - break; - - case self::TYPE_DISABLED: - default: - break; - } - } - - /** - * Destroy the connections. - */ - public function __destruct() - { - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - $this->server->close(); - break; - case self::TYPE_MEMCACHED: - $this->server->quit(); - break; - } - } - - /** - * Connect to the cache server(s). - * - * @throws CacheException - */ - private function connect() - { - $this->connected = false; - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - if ($this->socketFile === false) { - $servers = unserialize(NN_CACHE_HOSTS); - foreach ($servers as $server) { - if ($this->server->connect($server['host'], $server['port'], (float) NN_CACHE_TIMEOUT) === false) { - throw new CacheException('Error connecting to the Redis server!'); - } else { - $this->connected = true; - } - } - } else { - if ($this->server->connect(NN_CACHE_SOCKET_FILE) === false) { - throw new CacheException('Error connecting to the Redis server!'); - } else { - $this->connected = true; - } - } - break; - case self::TYPE_MEMCACHED: - $params = ($this->socketFile === false ? unserialize(NN_CACHE_HOSTS) : [[NN_CACHE_SOCKET_FILE, 'port' => 0]]); - if ($this->server->addServers($params) === false) { - throw new CacheException('Error connecting to the Memcached server!'); - } else { - $this->connected = true; - } - break; - case self::TYPE_APC: - $this->connected = true; - break; - } - } - - /** - * Check if we are still connected to the cache server, reconnect if not. - * - * - * @return bool - * @throws \Blacklight\libraries\CacheException - */ - private function ping() - { - if (! $this->connected) { - return false; - } - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - try { - return (bool) $this->server->ping(); - } catch (\RedisException $error) { - // nothing to see here, move along - } - break; - case self::TYPE_MEMCACHED: - $versions = $this->server->getVersion(); - if ($versions) { - foreach ($versions as $version) { - if ($version != '255.255.255') { - return true; - } - } - } - break; - case self::TYPE_APC: - return true; - default: - return false; - } - $this->connect(); - - return $this->connected; - } - - /** - * Verify the user selected serializer, return the memcached or redis appropriate serializer option. - * - * @return int - * @throws CacheException - */ - private function verifySerializer() - { - switch (NN_CACHE_SERIALIZER) { - case self::SERIALIZER_IGBINARY: - if (! \extension_loaded('igbinary')) { - throw new CacheException('Error: The igbinary extension is not loaded!'); - } - - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - // If this is not defined, it means phpredis was not compiled with --enable-redis-igbinary - if (! \defined('\Redis::SERIALIZER_IGBINARY')) { - throw new CacheException('Error: phpredis was not compiled with igbinary support!'); - } - - return \Redis::SERIALIZER_IGBINARY; - case self::TYPE_MEMCACHED: - if (\Memcached::HAVE_IGBINARY > 0) { - return \Memcached::SERIALIZER_IGBINARY; - } - throw new CacheException('Error: You have not compiled Memcached with igbinary support!'); - case self::TYPE_APC: // Ignore - set by apc.serializer setting. - default: - return null; - } - - // no break - case self::SERIALIZER_NONE: - // Only redis supports this. - if (NN_CACHE_TYPE !== self::TYPE_REDIS) { - throw new CacheException('Error: Disabled serialization is only available on Redis!'); - } - - return \Redis::SERIALIZER_NONE; - - case self::SERIALIZER_PHP: - default: - switch (NN_CACHE_TYPE) { - case self::TYPE_REDIS: - return \Redis::SERIALIZER_PHP; - case self::TYPE_MEMCACHED: - return \Memcached::SERIALIZER_PHP; - default: - return null; - } - } - } -} diff --git a/Blacklight/libraries/CacheException.php b/Blacklight/libraries/CacheException.php deleted file mode 100755 index 7a6ad7da7..000000000 --- a/Blacklight/libraries/CacheException.php +++ /dev/null @@ -1,29 +0,0 @@ -. - * @author niel - * @copyright 2015 nZEDb - */ - -namespace Blacklight\libraries; - -/** - * Class CacheException. - */ -class CacheException extends \Exception -{ -} diff --git a/Blacklight/libraries/FanartTV.php b/Blacklight/libraries/FanartTV.php index 49f74ca57..65caf1a21 100644 --- a/Blacklight/libraries/FanartTV.php +++ b/Blacklight/libraries/FanartTV.php @@ -32,7 +32,7 @@ class FanartTV * * @param string $id * - * @return array|bool + * @return array|false */ public function getMovieFanart($id) { @@ -52,7 +52,7 @@ class FanartTV * Getting tv show pictures. * * @param string $id - * @return array|bool + * @return array|false */ public function getTVFanart($id) { diff --git a/Blacklight/libraries/TraktAPI.php b/Blacklight/libraries/TraktAPI.php index ca029e5c4..85e4d54d4 100755 --- a/Blacklight/libraries/TraktAPI.php +++ b/Blacklight/libraries/TraktAPI.php @@ -58,7 +58,7 @@ class TraktAPI * @param string $ep * @param string $type * - * @return array|bool + * @return array|false * @see http://docs.trakt.apiary.io/#reference/episodes/summary/get-a-single-episode-for-a-show */ public function episodeSummary($id, $season = '', $ep = '', $type = 'min') @@ -86,7 +86,7 @@ class TraktAPI /** * Fetches weekend box office data from trakt.tv, updated every monday. * - * @return array|bool + * @return array|false * @see http://docs.trakt.apiary.io/#reference/movies/box-office/get-the-weekend-box-office */ public function getBoxOffice() @@ -107,7 +107,7 @@ class TraktAPI * @param string $start Start date of calendar ie. 2015-09-01.Default value is today. * @param int $days Number of days to lookup ahead. Default value is 7 days * - * @return array|bool + * @return array|false * @see http://docs.trakt.apiary.io/#reference/calendars/all-shows/get-shows */ public function getCalendar($start = '', $days = 7) @@ -194,7 +194,7 @@ class TraktAPI * * @see http://docs.trakt.apiary.io/#reference/movies/summary/get-a-movie * - * @return bool|array|string + * @return array|string|false */ public function movieSummary($movie = '', $type = 'imdbid') { @@ -259,7 +259,7 @@ class TraktAPI * * @see http://docs.trakt.apiary.io/#reference/search/get-text-query-results * - * @return bool|array|string + * @return array|false */ public function showSearch($show = '', $type = 'show') { @@ -274,12 +274,12 @@ class TraktAPI * Fetches summary from trakt.tv for the show. * Accepts a trakt slug (game-of-thrones), a IMDB id, or Trakt id. * - * @param string $show Title or IMDB id. - * @param string $type full: Return all extended properties. (returns array) + * @param string $show Title or IMDB id. + * @param string $type full: Return all extended properties. (returns array) * * @see http://docs.trakt.apiary.io/#reference/shows/summary/get-a-single-show * - * @return bool|array|string + * @return array|false|null */ public function showSummary($show = '', $type = 'full') { diff --git a/Blacklight/processing/adult/AEBN.php b/Blacklight/processing/adult/AEBN.php index 42ac64eca..3a7c20534 100755 --- a/Blacklight/processing/adult/AEBN.php +++ b/Blacklight/processing/adult/AEBN.php @@ -74,7 +74,8 @@ class AEBN extends AdultMovies /** * Gets Trailer URL .. will be processed in XXX insertswf. * - * @return array|bool + * + * @return array|mixed */ protected function trailers() { diff --git a/Blacklight/processing/adult/AdultMovies.php b/Blacklight/processing/adult/AdultMovies.php index 52562717a..5fc31caf0 100644 --- a/Blacklight/processing/adult/AdultMovies.php +++ b/Blacklight/processing/adult/AdultMovies.php @@ -73,7 +73,7 @@ abstract class AdultMovies /** * Gets all information. * - * @return array|bool + * @return array|false */ public function getAll() { @@ -84,32 +84,32 @@ abstract class AdultMovies } $dummy = $this->synopsis(); - if (is_array($dummy)) { + if (\is_array($dummy)) { $results = array_merge($results, $dummy); } $dummy = $this->productInfo(true); - if (is_array($dummy)) { + if (\is_array($dummy)) { $results = array_merge($results, $dummy); } $dummy = $this->cast(); - if (is_array($dummy)) { + if (\is_array($dummy)) { $results = array_merge($results, $dummy); } $dummy = $this->genres(); - if (is_array($dummy)) { + if (\is_array($dummy)) { $results = array_merge($results, $dummy); } $dummy = $this->covers(); - if (is_array($dummy)) { + if (\is_array($dummy)) { $results = array_merge($results, $dummy); } $dummy = $this->trailers(); - if (is_array($dummy)) { + if (\is_array($dummy)) { $results = array_merge($results, $dummy); } if (empty($results)) { diff --git a/Blacklight/processing/adult/Hotmovies.php b/Blacklight/processing/adult/Hotmovies.php index cb45f5eaf..7d59326af 100755 --- a/Blacklight/processing/adult/Hotmovies.php +++ b/Blacklight/processing/adult/Hotmovies.php @@ -200,7 +200,9 @@ class Hotmovies extends AdultMovies /** * Get Box Cover Images. - * @return bool|array - boxcover,backcover + * + * + * @return array|false|mixed */ protected function covers() { diff --git a/Blacklight/processing/adult/Popporn.php b/Blacklight/processing/adult/Popporn.php index c314d0579..467745b08 100755 --- a/Blacklight/processing/adult/Popporn.php +++ b/Blacklight/processing/adult/Popporn.php @@ -92,9 +92,7 @@ class Popporn extends AdultMovies } /** - * Gets the synopsis. - * - * @return array|bool + * @return array|mixed */ protected function synopsis() { @@ -116,9 +114,7 @@ class Popporn extends AdultMovies } /** - * Gets trailer video. - * - * @return array|bool + * @return array|mixed */ protected function trailers() { @@ -144,11 +140,9 @@ class Popporn extends AdultMovies } /** - * Process ProductInfo And/or Extras. - * * @param bool $extras * - * @return array|bool + * @return array|mixed */ protected function productInfo($extras = false) { @@ -198,9 +192,7 @@ class Popporn extends AdultMovies } /** - * Gets the cast members and director. - * - * @return array|bool + * @return array|mixed */ protected function cast() { diff --git a/Blacklight/processing/post/AniDB.php b/Blacklight/processing/post/AniDB.php index 88e2bbd13..0c5c03d92 100755 --- a/Blacklight/processing/post/AniDB.php +++ b/Blacklight/processing/post/AniDB.php @@ -187,9 +187,10 @@ class AniDB /** * Retrieves AniDB Info using a cleaned name. * + * * @param string $searchName * - * @return array|bool + * @return mixed */ private function getAnidbByName($searchName = '') { diff --git a/Blacklight/processing/post/ProcessAdditional.php b/Blacklight/processing/post/ProcessAdditional.php index 01ca5e171..1abfef726 100755 --- a/Blacklight/processing/post/ProcessAdditional.php +++ b/Blacklight/processing/post/ProcessAdditional.php @@ -79,22 +79,22 @@ class ProcessAdditional protected $_archiveInfo; /** - * @var array|bool|string + * @var bool|null|string */ protected $_innerFileBlacklist; /** - * @var array|bool|int|string + * @var int */ protected $_maxNestedLevels; /** - * @var array|bool|string + * @var null|string */ protected $_7zipPath; /** - * @var array|bool|string + * @var null|string */ protected $_unrarPath; diff --git a/Blacklight/processing/tv/TMDB.php b/Blacklight/processing/tv/TMDB.php index d8adffde1..88eb332de 100755 --- a/Blacklight/processing/tv/TMDB.php +++ b/Blacklight/processing/tv/TMDB.php @@ -230,7 +230,7 @@ class TMDB extends TV * * @param $cleanName * - * @return array|bool + * @return array|false */ protected function getShowInfo($cleanName) { @@ -255,7 +255,7 @@ class TMDB extends TV * @param array $shows * @param string $cleanName * - * @return array|bool + * @return array|false */ private function matchShowInfo($shows, $cleanName) { @@ -339,7 +339,7 @@ class TMDB extends TV * @param string $airdate * @param int $videoId * - * @return array|bool + * @return array|false */ protected function getEpisodeInfo($tmdbid, $season, $episode, $airdate = '', $videoId = 0) { diff --git a/Blacklight/processing/tv/TVMaze.php b/Blacklight/processing/tv/TVMaze.php index e62f8a002..a01c58c2c 100755 --- a/Blacklight/processing/tv/TVMaze.php +++ b/Blacklight/processing/tv/TVMaze.php @@ -225,8 +225,9 @@ class TVMaze extends TV * Returns a formatted array of show data or false if no match. * * - * @param string|null|array $cleanName - * @return array|bool|false + * @param string $cleanName + * + * @return array|false */ protected function getShowInfo($cleanName) { @@ -263,7 +264,7 @@ class TVMaze extends TV * @param $shows * @param $cleanName * - * @return array|bool + * @return array|false */ private function matchShowInfo(array $shows, $cleanName) { diff --git a/Blacklight/processing/tv/TraktTv.php b/Blacklight/processing/tv/TraktTv.php index e1ca8d27e..3bbf4e059 100755 --- a/Blacklight/processing/tv/TraktTv.php +++ b/Blacklight/processing/tv/TraktTv.php @@ -214,7 +214,7 @@ class TraktTv extends TV * @param int $series * @param int $episode * - * @return array|bool False on failure, an array of information fields otherwise. + * @return array|false False on failure, an array of information fields otherwise. */ public function getEpisodeInfo($siteId, $series, $episode) { diff --git a/Changelog b/Changelog index bed375d5a..ce2901a9f 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-08-03 DariusIII + * Chg: Update PHPDOC blocks defined return types where bool was declared and only false was returned * Chg: Update phpunit/phpunit to version 7.3.0 * Chg: Update updateExpiredRoles function * Fix: Fix setting role as default diff --git a/app/Models/Predb.php b/app/Models/Predb.php index 60394817d..c40fca8cc 100644 --- a/app/Models/Predb.php +++ b/app/Models/Predb.php @@ -141,7 +141,7 @@ class Predb extends Model * * @param string $cleanerName * - * @return array|bool Array with title/id from PreDB if found, bool False if not found. + * @return array|false Array with title/id from PreDB if found, false if not found. */ public static function matchPre($cleanerName) { diff --git a/app/Models/Settings.php b/app/Models/Settings.php index 920a01428..c030491b9 100644 --- a/app/Models/Settings.php +++ b/app/Models/Settings.php @@ -166,9 +166,10 @@ class Settings extends Model * either the value is passed to Settings::dottedToArray() for conversion. Otherwise the * value is returned unchanged. * - * @param $setting array|bool * - * @return array|bool + * @param $setting + * + * @return array|false */ public static function settingToArray($setting) { @@ -207,7 +208,7 @@ class Settings extends Model /** * @param $setting * - * @return array|bool + * @return array|false */ protected static function dottedToArray($setting) { diff --git a/app/Models/User.php b/app/Models/User.php index 8131e2579..985878bd3 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -234,9 +234,10 @@ class User extends Authenticatable /** * Get the users selected theme. * - * @param string|int $userID The id of the user. * - * @return array|bool The users selected theme. + * @param int $userID + * + * @return mixed|string */ public static function getStyle($userID) {