Skip to content

Commit 867c326

Browse files
committed
docs: add @psalm-suppress
I don't know why ERROR.
1 parent b8131e2 commit 867c326

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

system/Database/BaseConnection.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,15 +1006,18 @@ public function protectIdentifiers($item, bool $prefixSingle = false, ?bool $pro
10061006
// Added exception for single quotes as well, we don't want to alter
10071007
// literal strings.
10081008
if (strcspn($item, "()'") !== strlen($item)) {
1009+
/** @psalm-suppress NoValue I don't know why ERROR. */
10091010
return $item;
10101011
}
10111012

10121013
// Do not protect identifiers and do not prefix, no swap prefix, there is nothing to do
10131014
if ($protectIdentifiers === false && $prefixSingle === false && $this->swapPre === '') {
1015+
/** @psalm-suppress NoValue I don't know why ERROR. */
10141016
return $item;
10151017
}
10161018

10171019
// Convert tabs or multiple spaces into single spaces
1020+
/** @psalm-suppress NoValue I don't know why ERROR. */
10181021
$item = preg_replace('/\s+/', ' ', trim($item));
10191022

10201023
// If the item has an alias declaration we remove it and set it aside.
@@ -1176,6 +1179,7 @@ public function escapeIdentifiers($item)
11761179
}
11771180

11781181
foreach ($this->reservedIdentifiers as $id) {
1182+
/** @psalm-suppress NoValue I don't know why ERROR. */
11791183
if (strpos($item, '.' . $id) !== false) {
11801184
return preg_replace(
11811185
'/' . $this->pregEscapeChar[0] . '?([^' . $this->pregEscapeChar[1] . '\.]+)' . $this->pregEscapeChar[1] . '?\./i',
@@ -1185,6 +1189,7 @@ public function escapeIdentifiers($item)
11851189
}
11861190
}
11871191

1192+
/** @psalm-suppress NoValue I don't know why ERROR. */
11881193
return preg_replace(
11891194
'/' . $this->pregEscapeChar[0] . '?([^' . $this->pregEscapeChar[1] . '\.]+)' . $this->pregEscapeChar[1] . '?(\.)?/i',
11901195
$this->pregEscapeChar[2] . '$1' . $this->pregEscapeChar[3] . '$2',
@@ -1228,6 +1233,7 @@ public function escape($str)
12281233
return array_map([&$this, 'escape'], $str);
12291234
}
12301235

1236+
/** @psalm-suppress NoValue I don't know why ERROR. */
12311237
if (is_string($str) || (is_object($str) && method_exists($str, '__toString'))) {
12321238
if ($str instanceof RawSql) {
12331239
return $str->__toString();

system/Database/Postgre/Connection.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ public function escape($str)
188188
$this->initialize();
189189
}
190190

191+
/** @psalm-suppress NoValue I don't know why ERROR. */
191192
if (is_string($str) || (is_object($str) && method_exists($str, '__toString'))) {
192193
if ($str instanceof RawSql) {
193194
return $str->__toString();
@@ -200,6 +201,7 @@ public function escape($str)
200201
return $str ? 'TRUE' : 'FALSE';
201202
}
202203

204+
/** @psalm-suppress NoValue I don't know why ERROR. */
203205
return parent::escape($str);
204206
}
205207

0 commit comments

Comments
 (0)