Skip to content

Commit

Permalink
Casting to int something that's already int
Browse files Browse the repository at this point in the history
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
  • Loading branch information
kamil-tekiela committed Oct 15, 2022
1 parent 20ce0a8 commit 0ca6b45
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 26 deletions.
2 changes: 1 addition & 1 deletion libraries/classes/Controllers/Table/SearchController.php
Expand Up @@ -225,7 +225,7 @@ public function getDataRowAction(): void
$i = 0;
foreach ($row as $col => $val) {
if (isset($fields_meta[$i]) && $fields_meta[$i]->isMappedTypeBit) {
$row[$col] = Util::printableBitValue((int) $val, (int) $fields_meta[$i]->length);
$row[$col] = Util::printableBitValue((int) $val, $fields_meta[$i]->length);
}

$i++;
Expand Down
Expand Up @@ -284,7 +284,7 @@ public function getDataRowAction(): void
$i = 0;
foreach ($row as $col => $val) {
if ($fields_meta[$i]->isMappedTypeBit) {
$row[$col] = Util::printableBitValue((int) $val, (int) $fields_meta[$i]->length);
$row[$col] = Util::printableBitValue((int) $val, $fields_meta[$i]->length);
}

$i++;
Expand Down
2 changes: 1 addition & 1 deletion libraries/classes/Display/Results.php
Expand Up @@ -3147,7 +3147,7 @@ private function getDataCellForNonNumericColumns(
}

if ($meta->isMappedTypeBit) {
$displayedColumn = Util::printableBitValue((int) $displayedColumn, (int) $meta->length);
$displayedColumn = Util::printableBitValue((int) $displayedColumn, $meta->length);

// some results of PROCEDURE ANALYSE() are reported as
// being BINARY but they are quite readable,
Expand Down
15 changes: 0 additions & 15 deletions phpstan-baseline.neon
Expand Up @@ -1535,11 +1535,6 @@ parameters:
count: 1
path: libraries/classes/Controllers/Table/ReplaceController.php

-
message: "#^Casting to int something that's already int\\.$#"
count: 1
path: libraries/classes/Controllers/Table/SearchController.php

-
message: "#^Method PhpMyAdmin\\\\Controllers\\\\Table\\\\SearchController\\:\\:getColumnMinMax\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -1705,11 +1700,6 @@ parameters:
count: 1
path: libraries/classes/Controllers/Table/ZoomSearchController.php

-
message: "#^Casting to int something that's already int\\.$#"
count: 1
path: libraries/classes/Controllers/Table/ZoomSearchController.php

-
message: "#^Method PhpMyAdmin\\\\Controllers\\\\Table\\\\ZoomSearchController\\:\\:getColumnProperties\\(\\) return type has no value type specified in iterable type array\\.$#"
count: 1
Expand Down Expand Up @@ -2905,11 +2895,6 @@ parameters:
count: 2
path: libraries/classes/Display/Results.php

-
message: "#^Casting to int something that's already int\\.$#"
count: 1
path: libraries/classes/Display/Results.php

-
message: "#^Casting to string something that's already string\\.$#"
count: 2
Expand Down
9 changes: 1 addition & 8 deletions psalm-baseline.xml
Expand Up @@ -3921,9 +3921,6 @@
<PossiblyInvalidOperand occurrences="1">
<code>$_POST['where_clause']</code>
</PossiblyInvalidOperand>
<RedundantCastGivenDocblockType occurrences="1">
<code>(int) $fields_meta[$i]-&gt;length</code>
</RedundantCastGivenDocblockType>
</file>
<file src="libraries/classes/Controllers/Table/SqlController.php">
<MixedAssignment occurrences="2">
Expand Down Expand Up @@ -4442,9 +4439,6 @@
<code>$_POST['maxPlotLimit']</code>
<code>$_POST['where_clause']</code>
</PossiblyInvalidOperand>
<RedundantCastGivenDocblockType occurrences="1">
<code>(int) $fields_meta[$i]-&gt;length</code>
</RedundantCastGivenDocblockType>
</file>
<file src="libraries/classes/Controllers/TableController.php">
<MixedArgument occurrences="1">
Expand Down Expand Up @@ -6469,8 +6463,7 @@
<code>(int) $GLOBALS['cfg']['LimitChars']</code>
<code>(int) $GLOBALS['cfg']['LimitChars']</code>
</RedundantCast>
<RedundantCastGivenDocblockType occurrences="3">
<code>(int) $meta-&gt;length</code>
<RedundantCastGivenDocblockType occurrences="2">
<code>(string) $fieldsMeta[$i]-&gt;name</code>
<code>(string) $fieldsMeta[$i]-&gt;name</code>
</RedundantCastGivenDocblockType>
Expand Down

0 comments on commit 0ca6b45

Please sign in to comment.