1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

PHPStan: Use int for $limit

This commit is contained in:
Jakub Vrana
2025-03-30 21:08:19 +02:00
parent 016c1b2357
commit b50d19629f
14 changed files with 25 additions and 28 deletions

View File

@@ -344,10 +344,7 @@ if (isset($_GET["mongo"])) {
$val = preg_replace('~ DESC$~', '', $val, 1, $count);
$sort[$val] = ($count ? -1 : 1);
}
if (isset($_GET['limit']) && is_numeric($_GET['limit']) && $_GET['limit'] > 0) {
$limit = $_GET['limit'];
}
$limit = min(200, max(1, (int) $limit));
$limit = min(200, max(1, $limit));
$skip = $page * $limit;
try {
return new Result($this->conn->_link->executeQuery($this->conn->_db_name . ".$table", new \MongoDB\Driver\Query($where, array('projection' => $select, 'limit' => $limit, 'skip' => $skip, 'sort' => $sort))));