Skip to content

Commit 21cf996

Browse files
committed
Merge #18462 - Code improvement: NullableCompareToNullRector
Pull-request: #18462 Signed-off-by: William Desportes <williamdes@wdes.fr>
2 parents 62a44a7 + f4f2f93 commit 21cf996

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

libraries/classes/Config/PageSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ private function processPageSettings(FormDisplay $formDisplay, ConfigFile $cf):
113113
private function storeError(FormDisplay $formDisplay, Message|null $error): void
114114
{
115115
$retval = '';
116-
if ($error) {
116+
if ($error !== null) {
117117
$retval .= $error->getDisplay();
118118
}
119119

libraries/classes/Dbal/MysqliResult.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function __construct(mysqli_result|bool $result)
4343
*/
4444
public function getIterator(): Generator
4545
{
46-
if (! $this->result) {
46+
if ($this->result === null) {
4747
return;
4848
}
4949

@@ -62,7 +62,7 @@ public function getIterator(): Generator
6262
*/
6363
public function fetchAssoc(): array
6464
{
65-
if (! $this->result) {
65+
if ($this->result === null) {
6666
return [];
6767
}
6868

@@ -79,7 +79,7 @@ public function fetchAssoc(): array
7979
*/
8080
public function fetchRow(): array
8181
{
82-
if (! $this->result) {
82+
if ($this->result === null) {
8383
return [];
8484
}
8585

@@ -114,7 +114,7 @@ public function fetchValue(int|string $field = 0): string|false|null
114114
*/
115115
public function fetchAllAssoc(): array
116116
{
117-
if (! $this->result) {
117+
if ($this->result === null) {
118118
return [];
119119
}
120120

@@ -132,7 +132,7 @@ public function fetchAllAssoc(): array
132132
*/
133133
public function fetchAllColumn(): array
134134
{
135-
if (! $this->result) {
135+
if ($this->result === null) {
136136
return [];
137137
}
138138

@@ -153,7 +153,7 @@ public function fetchAllColumn(): array
153153
*/
154154
public function fetchAllKeyPair(): array
155155
{
156-
if (! $this->result) {
156+
if ($this->result === null) {
157157
return [];
158158
}
159159

@@ -170,7 +170,7 @@ public function fetchAllKeyPair(): array
170170
*/
171171
public function numFields(): int
172172
{
173-
if (! $this->result) {
173+
if ($this->result === null) {
174174
return 0;
175175
}
176176

@@ -184,7 +184,7 @@ public function numFields(): int
184184
*/
185185
public function numRows(): string|int
186186
{
187-
if (! $this->result) {
187+
if ($this->result === null) {
188188
return 0;
189189
}
190190

@@ -200,7 +200,7 @@ public function numRows(): string|int
200200
*/
201201
public function seek(int $offset): bool
202202
{
203-
if (! $this->result) {
203+
if ($this->result === null) {
204204
return false;
205205
}
206206

@@ -215,7 +215,7 @@ public function seek(int $offset): bool
215215
*/
216216
public function getFieldsMeta(): array
217217
{
218-
if (! $this->result) {
218+
if ($this->result === null) {
219219
return [];
220220
}
221221

@@ -235,7 +235,7 @@ public function getFieldsMeta(): array
235235
*/
236236
public function getFieldNames(): array
237237
{
238-
if (! $this->result) {
238+
if ($this->result === null) {
239239
return [];
240240
}
241241

libraries/classes/ErrorHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ protected function dispPageStart(Error|null $error = null): void
373373
{
374374
ResponseRenderer::getInstance()->disable();
375375
echo '<html><head><title>';
376-
if ($error) {
376+
if ($error !== null) {
377377
echo $error->getTitle();
378378
} else {
379379
echo 'phpMyAdmin error reporting page';

0 commit comments

Comments
 (0)