Enable checkTooWideReturnTypesInProtectedAndPublicMethods
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
51a855a5cc
commit
affd2b9d7f
@ -13,6 +13,7 @@ use PhpMyAdmin\FieldMetadata;
|
||||
use Webmozart\Assert\Assert;
|
||||
|
||||
use function array_column;
|
||||
use function array_key_exists;
|
||||
use function is_array;
|
||||
use function is_bool;
|
||||
use function is_string;
|
||||
@ -104,7 +105,11 @@ final class MysqliResult implements ResultInterface
|
||||
$row = $this->fetchRow();
|
||||
}
|
||||
|
||||
return $row[$field] ?? false;
|
||||
if (! array_key_exists($field, $row)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $row[$field];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -6910,6 +6910,11 @@ parameters:
|
||||
count: 1
|
||||
path: libraries/classes/Plugins/Import/ImportXml.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\Plugins\\\\Import\\\\ShapeFileImport\\:\\:readSHP\\(\\) never returns false so it can be removed from the return type\\.$#"
|
||||
count: 1
|
||||
path: libraries/classes/Plugins/Import/ShapeFileImport.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\Plugins\\\\Import\\\\Upload\\\\UploadNoplugin\\:\\:getUploadStatus\\(\\) return type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
@ -11805,6 +11810,11 @@ parameters:
|
||||
count: 1
|
||||
path: test/classes/StorageEngineTest.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\Tests\\\\Stubs\\\\DbiDummy\\:\\:connect\\(\\) never returns null so it can be removed from the return type\\.$#"
|
||||
count: 1
|
||||
path: test/classes/Stubs/DbiDummy.php
|
||||
|
||||
-
|
||||
message: "#^Method PhpMyAdmin\\\\Tests\\\\Stubs\\\\DbiDummy\\:\\:fetchAny\\(\\) return type has no value type specified in iterable type array\\.$#"
|
||||
count: 1
|
||||
|
||||
@ -35,3 +35,4 @@ parameters:
|
||||
checkUninitializedProperties: true
|
||||
polluteScopeWithAlwaysIterableForeach: true
|
||||
checkDynamicProperties: true
|
||||
checkTooWideReturnTypesInProtectedAndPublicMethods: true
|
||||
|
||||
@ -12,6 +12,7 @@ use PhpMyAdmin\Dbal\ResultInterface;
|
||||
use PhpMyAdmin\FieldMetadata;
|
||||
|
||||
use function array_column;
|
||||
use function array_key_exists;
|
||||
use function is_string;
|
||||
|
||||
/**
|
||||
@ -103,7 +104,11 @@ class DummyResult implements ResultInterface
|
||||
$row = $this->fetchRow();
|
||||
}
|
||||
|
||||
return $row[$field] ?? false;
|
||||
if (! array_key_exists($field, $row)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $row[$field];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user