mirror of
https://github.com/dg/dibi.git
synced 2025-07-31 11:20:25 +02:00
Use null coalescing operator (#340)
This commit is contained in:
committed by
David Grudl
parent
f46b7f4d79
commit
74ba6cfd34
@@ -331,7 +331,7 @@ class MySqliDriver implements Dibi\Driver
|
||||
|
||||
} elseif ($limit !== null || $offset) {
|
||||
// see http://dev.mysql.com/doc/refman/5.0/en/select.html
|
||||
$sql .= ' LIMIT ' . ($limit === null ? '18446744073709551615' : $limit)
|
||||
$sql .= ' LIMIT ' . ($limit ?? '18446744073709551615')
|
||||
. ($offset ? ' OFFSET ' . $offset : '');
|
||||
}
|
||||
}
|
||||
|
@@ -367,7 +367,7 @@ class PdoDriver implements Dibi\Driver
|
||||
case 'mysql':
|
||||
if ($limit !== null || $offset) {
|
||||
// see http://dev.mysql.com/doc/refman/5.0/en/select.html
|
||||
$sql .= ' LIMIT ' . ($limit === null ? '18446744073709551615' : $limit)
|
||||
$sql .= ' LIMIT ' . ($limit ?? '18446744073709551615')
|
||||
. ($offset ? ' OFFSET ' . $offset : '');
|
||||
}
|
||||
break;
|
||||
@@ -383,7 +383,7 @@ class PdoDriver implements Dibi\Driver
|
||||
|
||||
case 'sqlite':
|
||||
if ($limit !== null || $offset) {
|
||||
$sql .= ' LIMIT ' . ($limit === null ? '-1' : $limit)
|
||||
$sql .= ' LIMIT ' . ($limit ?? '-1')
|
||||
. ($offset ? ' OFFSET ' . $offset : '');
|
||||
}
|
||||
break;
|
||||
|
@@ -267,7 +267,7 @@ class SqliteDriver implements Dibi\Driver
|
||||
throw new Dibi\NotSupportedException('Negative offset or limit.');
|
||||
|
||||
} elseif ($limit !== null || $offset) {
|
||||
$sql .= ' LIMIT ' . ($limit === null ? '-1' : $limit)
|
||||
$sql .= ' LIMIT ' . ($limit ?? '-1')
|
||||
. ($offset ? ' OFFSET ' . $offset : '');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user