diff options
| author | 2022-06-19 20:08:42 +0200 | |
|---|---|---|
| committer | 2022-06-19 20:08:42 +0200 | |
| commit | f365a9aeb44c33a1c817ae19a6027aa0fbffd706 (patch) | |
| tree | 6f93f55d5c71eda6672168a7f1250ad1d784c5ef /app/Models | |
| parent | 238e55b2fd7f08b5ce866b712c43c1a8fa03a657 (diff) | |
Update all test dependencies (#4419)
* Update all test dependencies
* Remove old false-positive
* Minor update lock files
* Increase PHPStan memory for Fedora
https://github.com/FreshRSS/FreshRSS/pull/4400#issuecomment-1159514197
* Require PHP8+ for tests
Due to small changes of signature in `ob_implicit_flush` and `simplexml_load_string`, cf. https://github.com/FreshRSS/FreshRSS/pull/4123
* Missing lint in CSS files
Diffstat (limited to 'app/Models')
| -rw-r--r-- | app/Models/BooleanSearch.php | 4 | ||||
| -rw-r--r-- | app/Models/DatabaseDAO.php | 2 | ||||
| -rw-r--r-- | app/Models/Feed.php | 2 | ||||
| -rw-r--r-- | app/Models/FeedDAO.php | 4 | ||||
| -rw-r--r-- | app/Models/TagDAO.php | 4 |
5 files changed, 7 insertions, 9 deletions
diff --git a/app/Models/BooleanSearch.php b/app/Models/BooleanSearch.php index 4cb74865a..332757556 100644 --- a/app/Models/BooleanSearch.php +++ b/app/Models/BooleanSearch.php @@ -223,9 +223,7 @@ class FreshRSS_BooleanSearch { $quotes = substr_count($segment, '"') + substr_count($segment, '"'); if ($quotes % 2 === 0) { $segment = trim($segment); - if ($segment != '') { - $this->searches[] = new FreshRSS_Search($segment); - } + $this->searches[] = new FreshRSS_Search($segment); $segment = ''; } } diff --git a/app/Models/DatabaseDAO.php b/app/Models/DatabaseDAO.php index 7c4daee97..bf9cbb2d3 100644 --- a/app/Models/DatabaseDAO.php +++ b/app/Models/DatabaseDAO.php @@ -160,7 +160,7 @@ class FreshRSS_DatabaseDAO extends Minz_ModelPdo { foreach ($tables as $table) { $sql = 'OPTIMIZE TABLE `_' . $table . '`'; //MySQL $stm = $this->pdo->query($sql); - if ($stm == false || $stm->fetchAll(PDO::FETCH_ASSOC) === false) { + if ($stm == false || $stm->fetchAll(PDO::FETCH_ASSOC) == false) { $ok = false; $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); Minz_Log::warning(__METHOD__ . ' error: ' . $sql . ' : ' . json_encode($info)); diff --git a/app/Models/Feed.php b/app/Models/Feed.php index b3692acbe..d4966f4e4 100644 --- a/app/Models/Feed.php +++ b/app/Models/Feed.php @@ -966,7 +966,7 @@ class FreshRSS_Feed extends Minz_Model { ' via hub ' . $hubJson['hub'] . ' with callback ' . $callbackUrl . ': ' . $info['http_code'] . ' ' . $response, PSHB_LOG); - if (substr($info['http_code'], 0, 1) == '2') { + if (substr('' . $info['http_code'], 0, 1) == '2') { return true; } else { $hubJson['lease_start'] = time(); //Prevent trying again too soon diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php index 89e667813..86ba70d5c 100644 --- a/app/Models/FeedDAO.php +++ b/app/Models/FeedDAO.php @@ -363,7 +363,7 @@ SQL; if ($stm !== false) { return self::daoToFeed($stm->fetchAll(PDO::FETCH_ASSOC)); } else { - $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); + $info = $this->pdo->errorInfo(); if ($this->autoUpdateDb($info)) { return $this->listFeedsOrderUpdate($defaultCacheDuration); } @@ -600,7 +600,7 @@ SQL; $sql2 = 'ALTER TABLE `_feed` ADD COLUMN ttl INT NOT NULL DEFAULT ' . FreshRSS_Feed::TTL_DEFAULT; //v0.7.3 $stm = $this->pdo->query($sql2); if ($stm === false) { - $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); + $info = $this->pdo->errorInfo(); Minz_Log::error('SQL error updateTTL 2: ' . $info[2] . ' ' . $sql2); } } else { diff --git a/app/Models/TagDAO.php b/app/Models/TagDAO.php index 7f1fcae24..49abbdefd 100644 --- a/app/Models/TagDAO.php +++ b/app/Models/TagDAO.php @@ -239,7 +239,7 @@ SQL; if ($stm !== false) { return self::daoToTag($stm->fetchAll(PDO::FETCH_ASSOC)); } else { - $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); + $info = $this->pdo->errorInfo(); if ($this->autoUpdateDb($info)) { return $this->listTags($precounts); } @@ -274,7 +274,7 @@ SQL; $res = $stm->fetchAll(PDO::FETCH_ASSOC); return $res[0]['count']; } else { - $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); + $info = $this->pdo->errorInfo(); if ($this->autoUpdateDb($info)) { return $this->count(); } |
