Fix issues reported by scrutinizer (strings where arrays are expected and vice versa)

This commit is contained in:
DariusIII
2019-01-21 11:43:52 +01:00
parent 26bb14e290
commit 44882e5728
4 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -2470,7 +2470,7 @@ class NameFixer
$this->_cleanMatchFiles();
$this->cleanFileNames();
if (! empty($this->_fileName)) {
foreach ($this->sphinx->searchIndexes('predb_rt', $this->_fileName, 'title') as $match) {
foreach ($this->sphinx->searchIndexes('predb_rt', $this->_fileName, ['title']) as $match) {
if (! empty($match)) {
$this->updateRelease($release, $match['title'], 'PreDb: Title match', $echo, $type, $nameStatus, $show, $match['id']);
+1 -1
View File
@@ -635,7 +635,7 @@ class Releases
$results = $this->sphinxSearch->searchIndexes('releases_rt', '', '', $searchFields);
$results = $this->sphinxSearch->searchIndexes('releases_rt', '', [], $searchFields);
$searchResult = array_pluck($results, 'id');
+1
View File
@@ -1,4 +1,5 @@
2019-01-21 DariusIII
* Fix: Fix issues reported by scrutinizer (strings where arrays are expected and vice versa)
* Chg: Update search, update matching
2019-01-20 DariusIII
* Chg: Update rest of the cover checking files
+3 -3
View File
@@ -173,17 +173,17 @@ class Predb extends Model
}
/**
* @param array $search
* @param string $search
*
* @return mixed
* @throws \Exception
*/
public static function getAll($search = [])
public static function getAll($search = '')
{
$sql = self::query()->remember(config('nntmux.cache_expiry_medium'))->leftJoin('releases', 'releases.predb_id', '=', 'predb.id')->orderByDesc('predb.predate');
if (! empty($search)) {
$sphinx = new SphinxSearch();
$ids = array_pluck($sphinx->searchIndexes('predb_rt', $search, 'title'), 'id');
$ids = array_pluck($sphinx->searchIndexes('predb_rt', $search, ['title']), 'id');
$sql->whereIn('predb.id', $ids);
}