Refactor getPartitionMethod()
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
This commit is contained in:
parent
b687a6f62b
commit
e41782c403
@ -11118,12 +11118,6 @@ parameters:
|
||||
count: 2
|
||||
path: src/Partitioning/Partition.php
|
||||
|
||||
-
|
||||
message: '#^Method PhpMyAdmin\\Partitioning\\Partition\:\:getPartitionMethod\(\) should return string\|null but returns mixed\.$#'
|
||||
identifier: return.type
|
||||
count: 1
|
||||
path: src/Partitioning/Partition.php
|
||||
|
||||
-
|
||||
message: '#^Only booleans are allowed in an if condition, string\|false\|null given\.$#'
|
||||
identifier: if.condNotBoolean
|
||||
|
||||
@ -6497,12 +6497,6 @@
|
||||
<code><![CDATA[$this->name]]></code>
|
||||
<code><![CDATA[$value]]></code>
|
||||
</MixedAssignment>
|
||||
<MixedInferredReturnType>
|
||||
<code><![CDATA[string|null]]></code>
|
||||
</MixedInferredReturnType>
|
||||
<MixedReturnStatement>
|
||||
<code><![CDATA[$partitionMethod[0]]]></code>
|
||||
</MixedReturnStatement>
|
||||
<PossiblyInvalidArgument>
|
||||
<code><![CDATA[$row]]></code>
|
||||
</PossiblyInvalidArgument>
|
||||
|
||||
@ -207,14 +207,14 @@ class Partition extends SubPartition
|
||||
{
|
||||
if (self::havePartitioning()) {
|
||||
$dbi = DatabaseInterface::getInstance();
|
||||
$partitionMethod = $dbi->fetchResultSimple(
|
||||
$partitionMethod = $dbi->fetchValue(
|
||||
'SELECT `PARTITION_METHOD` FROM `information_schema`.`PARTITIONS`'
|
||||
. ' WHERE `TABLE_SCHEMA` = ' . $dbi->quoteString($db)
|
||||
. ' AND `TABLE_NAME` = ' . $dbi->quoteString($table)
|
||||
. ' LIMIT 1',
|
||||
);
|
||||
if ($partitionMethod !== []) {
|
||||
return $partitionMethod[0];
|
||||
if ($partitionMethod !== false) {
|
||||
return $partitionMethod;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user