diff options
| author | 2023-07-07 22:36:27 +0200 | |
|---|---|---|
| committer | 2023-07-07 22:36:27 +0200 | |
| commit | f8f163d054110f7e0ff6650fca146b474335f4bd (patch) | |
| tree | dbd831e600bc76ca2830cd417bd52b712ff97309 /app/Models/EntryDAOSQLite.php | |
| parent | 7f9594b8c7d7799f2e5f89328bd5981410db8cf0 (diff) | |
Chore/processing of depreciations and updating code to php72 minimum (#5504)
* processing of depreciations and updating of code to php7.2 minimum
* Autoformat many strange array indenting
And revert a few unwanted changes
---------
Co-authored-by: Luc <sanchezluc+freshrss@gmail.com>
Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/Models/EntryDAOSQLite.php')
| -rw-r--r-- | app/Models/EntryDAOSQLite.php | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php index 58a61828b..6abf31a5b 100644 --- a/app/Models/EntryDAOSQLite.php +++ b/app/Models/EntryDAOSQLite.php @@ -86,7 +86,7 @@ SET `cache_nbUnreads`=( WHERE e.id_feed=`_feed`.id AND e.is_read=0) SQL; $hasWhere = false; - $values = array(); + $values = []; if ($feedId != null) { $sql .= ' WHERE'; $hasWhere = true; @@ -135,7 +135,7 @@ SQL; } else { $this->pdo->beginTransaction(); $sql = 'UPDATE `_entry` SET is_read=? WHERE id=? AND is_read=?'; - $values = array($is_read ? 1 : 0, $ids, $is_read ? 0 : 1); + $values = [$is_read ? 1 : 0, $ids, $is_read ? 0 : 1]; $stm = $this->pdo->prepare($sql); if (!($stm && $stm->execute($values))) { $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); @@ -147,7 +147,7 @@ SQL; if ($affected > 0) { $sql = 'UPDATE `_feed` SET `cache_nbUnreads`=`cache_nbUnreads`' . ($is_read ? '-' : '+') . '1 ' . 'WHERE id=(SELECT e.id_feed FROM `_entry` e WHERE e.id=?)'; - $values = array($ids); + $values = [$ids]; $stm = $this->pdo->prepare($sql); if (!($stm && $stm->execute($values))) { $info = $stm == null ? $this->pdo->errorInfo() : $stm->errorInfo(); @@ -196,9 +196,9 @@ SQL; } elseif ($priorityMin >= 0) { $sql .= ' AND id_feed IN (SELECT f.id FROM `_feed` f WHERE f.priority > ' . intval($priorityMin) . ')'; } - $values = array($is_read ? 1 : 0, $is_read ? 1 : 0, $idMax); + $values = [$is_read ? 1 : 0, $is_read ? 1 : 0, $idMax]; - list($searchValues, $search) = $this->sqlListEntriesWhere('', $filters, $state); + [$searchValues, $search] = $this->sqlListEntriesWhere('', $filters, $state); $stm = $this->pdo->prepare($sql . $search); if (!($stm && $stm->execute(array_merge($values, $searchValues)))) { @@ -235,9 +235,9 @@ SQL; . 'SET is_read = ? ' . 'WHERE is_read <> ? AND id <= ? AND ' . 'id_feed IN (SELECT f.id FROM `_feed` f WHERE f.category=?)'; - $values = array($is_read ? 1 : 0, $is_read ? 1 : 0, $idMax, $id); + $values = [$is_read ? 1 : 0, $is_read ? 1 : 0, $idMax, $id]; - list($searchValues, $search) = $this->sqlListEntriesWhere('', $filters, $state); + [$searchValues, $search] = $this->sqlListEntriesWhere('', $filters, $state); $stm = $this->pdo->prepare($sql . $search); if (!($stm && $stm->execute(array_merge($values, $searchValues)))) { @@ -271,12 +271,12 @@ SQL; . 'id IN (SELECT et.id_entry FROM `_entrytag` et ' . ($id == 0 ? '' : 'WHERE et.id_tag = ?') . ')'; - $values = array($is_read ? 1 : 0, $is_read ? 1 : 0, $idMax); + $values = [$is_read ? 1 : 0, $is_read ? 1 : 0, $idMax]; if ($id != 0) { $values[] = $id; } - list($searchValues, $search) = $this->sqlListEntriesWhere('e.', $filters, $state); + [$searchValues, $search] = $this->sqlListEntriesWhere('e.', $filters, $state); $stm = $this->pdo->prepare($sql . $search); if (!($stm && $stm->execute(array_merge($values, $searchValues)))) { |
