Fix return type declarations

This commit is contained in:
DariusIII
2023-04-02 17:38:14 +02:00
parent 66f9a1637a
commit 7f31b103dc
10 changed files with 68 additions and 69 deletions
-1
View File
@@ -447,7 +447,6 @@ class IRCClient
if (! empty($channels)) {
foreach ($channels as $channel => $password) {
$this->_joinChannel($channel, $password ?? '');
}
}
+10 -11
View File
@@ -12,14 +12,14 @@ class ADE extends AdultMovies
*
* @var string
*/
protected $directLink = '';
protected string $directLink = '';
/**
* Search keyword.
*
* @var string
*/
protected $searchTerm = '';
protected string $searchTerm = '';
/**
* Define ADE Url here.
@@ -31,17 +31,17 @@ class ADE extends AdultMovies
*
* @var string
*/
protected $_directUrl = '';
protected string $_directUrl = '';
/**
* Sets the title in the getAll method.
*
* @var string
*/
protected $_title = '';
protected string $_title = '';
/** Trailing urls */
protected $_dvdQuery = '/dvd/search?q=';
protected string $_dvdQuery = '/dvd/search?q=';
protected $_scenes = '/scenes';
@@ -147,9 +147,9 @@ class ADE extends AdultMovies
/**
* Gets Genres, if exists return array else return false.
*
* @return mixed array - Genres
* @return mixed - Genres
*/
protected function genres()
protected function genres(): mixed
{
$genres = [];
foreach ($this->_html->find('[Label="Category"]') as $a) {
@@ -163,11 +163,10 @@ class ADE extends AdultMovies
}
/**
* Gets Product Information and/or Features.
*
* @return array - ProductInfo/Extras = features
* @param bool $extras
* @return mixed
*/
protected function productInfo(bool $extras = false): array
protected function productInfo(bool $extras = false): mixed
{
$dofeature = null;
$this->_tmpResponse = str_ireplace('Section ProductInfo', 'spdinfo', $this->_response);
+10 -10
View File
@@ -20,35 +20,35 @@ class ADM extends AdultMovies
*
* @var string string
*/
public $cookie = '';
public string $cookie = '';
/**
* Direct Link given from outside url doesn't do a search.
*
* @var string
*/
protected $directLink = '';
protected string $directLink = '';
/**
* Set this for what you are searching for.
*
* @var string
*/
protected $searchTerm = '';
protected string $searchTerm = '';
/**
* Sets the directurl for the return results array.
*
* @var string
*/
protected $_directUrl = '';
protected string $_directUrl = '';
/**
* Results returned from each method.
*
* @var array
*/
protected $_res = [];
protected array $_res = [];
/**
* Curl Raw Html.
@@ -60,14 +60,14 @@ class ADM extends AdultMovies
*
* @var string
*/
protected $_trailUrl = '';
protected string $_trailUrl = '';
/**
* This is set in the getAll method.
*
* @var string
*/
protected $_title = '';
protected string $_title = '';
/**
* Get Box Cover Images.
@@ -109,7 +109,7 @@ class ADM extends AdultMovies
/**
* Get Product Information and Director.
*/
protected function productInfo(bool $extras = false): array
protected function productInfo(bool $extras = false): mixed
{
foreach ($this->_html->find('ul.list-unstyled li') as $li) {
$category = explode(':', $li->plaintext);
@@ -175,7 +175,7 @@ class ADM extends AdultMovies
*
* @return bool - true if search = 100%
*/
public function processSite($movie): bool
public function processSite(string $movie): bool
{
$result = false;
if (! empty($movie)) {
@@ -209,7 +209,7 @@ class ADM extends AdultMovies
return $result;
}
protected function trailers()
protected function trailers(): mixed
{
// TODO: Implement trailers() method.
+5 -5
View File
@@ -27,7 +27,7 @@ class AEBN extends AdultMovies
*
* @var string
*/
protected $_directUrl = '';
protected string $_directUrl = '';
/**
* Raw Html response from curl.
@@ -60,15 +60,15 @@ class AEBN extends AdultMovies
*
* @var string
*/
protected $_title = '';
protected string $_title = '';
/**
* Gets Trailer URL .. will be processed in XXX insertswf.
*
*
* @return array|mixed
* @return mixed
*/
protected function trailers()
protected function trailers(): mixed
{
$ret = $this->_html->find('a[itemprop=trailer]', 0);
if (! empty($ret) && preg_match('/movieId=(?<movieid>\d+)&/', trim($ret->href), $hits)) {
@@ -142,7 +142,7 @@ class AEBN extends AdultMovies
/**
* Gets the product information.
*/
protected function productInfo(bool $extras = false): array
protected function productInfo(bool $extras = false): mixed
{
if ($ret = $this->_html->find('div#md-detailsLeft', 0)) {
foreach ($ret->find('div') as $div) {
+14 -14
View File
@@ -9,17 +9,17 @@ abstract class AdultMovies
/**
* @var \voku\helper\HtmlDomParser
*/
protected $_html;
protected HtmlDomParser $_html;
/**
* @var string
*/
protected $_title;
protected string $_title;
/**
* @var string
*/
protected $_directUrl;
protected string $_directUrl;
/**
* AdultMovies constructor.
@@ -30,48 +30,48 @@ abstract class AdultMovies
}
/**
* @param bool $extras
* @return mixed
* @param bool $extras
* @return array|mixed
*/
abstract protected function productInfo($extras = false);
abstract protected function productInfo(bool $extras = false): mixed;
/**
* @return mixed
*/
abstract protected function covers();
abstract protected function covers(): mixed;
/**
* @return mixed
*/
abstract protected function synopsis();
abstract protected function synopsis(): mixed;
/**
* @return mixed
*/
abstract protected function cast();
abstract protected function cast(): mixed;
/**
* @return mixed
*/
abstract protected function genres();
abstract protected function genres(): mixed;
/**
* @param string $movie
* @param string $movie
* @return mixed
*/
abstract public function processSite($movie);
abstract public function processSite(string $movie): mixed;
/**
* @return mixed
*/
abstract protected function trailers();
abstract protected function trailers(): mixed;
/**
* Gets all information.
*
* @return array|false
*/
public function getAll()
public function getAll(): bool|array
{
$results = [];
if ($this->_directUrl !== null) {
+7 -7
View File
@@ -40,7 +40,7 @@ class Hotmovies extends AdultMovies
*
* @var string
*/
protected $_directUrl = '';
protected string $_directUrl = '';
/**
* Sets the link to get in curl.
@@ -73,9 +73,9 @@ class Hotmovies extends AdultMovies
*
* @var string
*/
protected $_title = '';
protected string $_title = '';
protected function trailers()
protected function trailers(): mixed
{
// TODO: Implement trailers() method.
@@ -101,7 +101,7 @@ class Hotmovies extends AdultMovies
/**
* Process ProductInfo.
*/
protected function productInfo(bool $extras = false): array
protected function productInfo(bool $extras = false): mixed
{
$studio = false;
$director = false;
@@ -166,7 +166,7 @@ class Hotmovies extends AdultMovies
$genres = [];
if ($ret = $this->_html->findOne('div.categories')) {
foreach ($ret->find('a') as $e) {
if (strpos($e->title, ' -> ') !== false) {
if (str_contains($e->title, ' -> ')) {
$e = explode(' -> ', $e->plaintext);
$genres[] = trim($e[1]);
}
@@ -181,9 +181,9 @@ class Hotmovies extends AdultMovies
* Get Box Cover Images.
*
*
* @return array|false|mixed
* @return mixed
*/
protected function covers()
protected function covers(): mixed
{
if ($ret = $this->_html->find('div#large_cover, img#cover', 1)) {
$this->_res['boxcover'] = trim($ret->src);
+13 -12
View File
@@ -9,14 +9,14 @@ class Popporn extends AdultMovies
*
* @var string string
*/
public $cookie = '';
public string $cookie = '';
/**
* Set this for what you are searching for.
*
* @var string
*/
protected $searchTerm = '';
protected string $searchTerm = '';
/**
* Override if 18 years+ or older
@@ -34,7 +34,7 @@ class Popporn extends AdultMovies
*
* @var string
*/
protected $_directUrl = '';
protected string $_directUrl = '';
/**
* Curl Raw Html.
@@ -46,21 +46,21 @@ class Popporn extends AdultMovies
*
* @var array
*/
protected $_res = [];
protected array $_res = [];
/**
* This is set in the getAll method.
*
* @var string
*/
protected $_title = '';
protected string $_title = '';
/**
* Add this to popurl to get results.
*
* @var string
*/
protected $_trailUrl = '';
protected string $_trailUrl = '';
private $_postParams;
@@ -91,9 +91,9 @@ class Popporn extends AdultMovies
}
/**
* @return array|mixed
* @return mixed
*/
protected function synopsis()
protected function synopsis(): mixed
{
if ($ret = $this->_html->find('div[id=product-info] ,h3[class=highlight]', 1)) {
if ($ret->next_sibling()->plaintext) {
@@ -113,9 +113,9 @@ class Popporn extends AdultMovies
}
/**
* @return array|mixed
* @return mixed
*/
protected function trailers()
protected function trailers(): mixed
{
if ($ret = $this->_html->findOne('input#thickbox-trailer-link')) {
$ret->value = trim($ret->value);
@@ -139,9 +139,10 @@ class Popporn extends AdultMovies
}
/**
* @return array|mixed
* @param bool $extras
* @return mixed
*/
protected function productInfo(bool $extras = false)
protected function productInfo(bool $extras = false): mixed
{
$country = false;
if ($ret = $this->_html->findOne('div#lside')) {
+1 -1
View File
@@ -33,7 +33,7 @@ class TMDB extends TV
/**
* Fetch banner from site.
*/
public function getBanner($videoId, $siteID): bool
public function getBanner($videoId, $siteId): bool
{
return false;
}
+1 -1
View File
@@ -41,7 +41,7 @@ class TVMaze extends TV
/**
* Fetch banner from site.
*/
public function getBanner($videoId, $siteID): bool
public function getBanner($videoId, $siteId): bool
{
return false;
}
+7 -7
View File
@@ -187,7 +187,7 @@ class TraktTv extends TV
/**
* Fetch banner from site.
*/
public function getBanner($videoId, $siteID): bool
public function getBanner($videoId, $siteId): bool
{
return false;
}
@@ -223,25 +223,25 @@ class TraktTv extends TV
*/
public function getPoster(int $videoId): int
{
$hascover = 0;
$hasCover = 0;
$ri = new ReleaseImage();
if ($this->posterUrl !== '') {
// Try to get the Poster
$hascover = $ri->saveImage($videoId, $this->posterUrl, $this->imgSavePath, '', '');
$hasCover = $ri->saveImage($videoId, $this->posterUrl, $this->imgSavePath, '', '');
}
// Couldn't get poster, try fan art instead
if ($hascover !== 1 && $this->fanartUrl !== '') {
$hascover = $ri->saveImage($videoId, $this->fanartUrl, $this->imgSavePath, '', '');
if ($hasCover !== 1 && $this->fanartUrl !== '') {
$hasCover = $ri->saveImage($videoId, $this->fanartUrl, $this->imgSavePath, '', '');
}
// Mark it retrieved if we saved an image
if ($hascover === 1) {
if ($hasCover === 1) {
$this->setCoverFound($videoId);
}
return $hascover;
return $hasCover;
}
/**