Skip to content

Commit

Permalink
Merge pull request phpmyadmin#18973 from kamil-tekiela/Refactor-Data
Browse files Browse the repository at this point in the history
Refactor Status\Data class
  • Loading branch information
MauricioFauth authored Feb 6, 2024
2 parents 5baf6ec + b715c81 commit b53d63c
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 187 deletions.
25 changes: 0 additions & 25 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -13745,11 +13745,6 @@ parameters:
count: 1
path: src/Server/Select.php

-
message: "#^Cannot access offset 'Com_admin_commands' on mixed\\.$#"
count: 1
path: src/Server/Status/Data.php

-
message: "#^Cannot access offset 'doc' on mixed\\.$#"
count: 4
Expand All @@ -13775,26 +13770,6 @@ parameters:
count: 1
path: src/Server/Status/Data.php

-
message: "#^Parameter \\#2 \\$needle of function str_contains expects string, \\(int\\|string\\) given\\.$#"
count: 1
path: src/Server/Status/Data.php

-
message: "#^Property PhpMyAdmin\\\\Server\\\\Status\\\\Data\\:\\:\\$allocationMap \\(array\\) does not accept mixed\\.$#"
count: 1
path: src/Server/Status/Data.php

-
message: "#^Property PhpMyAdmin\\\\Server\\\\Status\\\\Data\\:\\:\\$sectionUsed \\(array\\) does not accept mixed\\.$#"
count: 1
path: src/Server/Status/Data.php

-
message: "#^Property PhpMyAdmin\\\\Server\\\\Status\\\\Data\\:\\:\\$usedQueries \\(array\\) does not accept mixed\\.$#"
count: 1
path: src/Server/Status/Data.php

-
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 4
Expand Down
36 changes: 16 additions & 20 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2899,7 +2899,6 @@
<code>$linkName</code>
<code>$linkUrl</code>
<code>$sectionLinks</code>
<code>$sectionName</code>
<code>$value</code>
</MixedAssignment>
<MixedOperand>
Expand Down Expand Up @@ -10984,30 +10983,18 @@
</file>
<file src="src/Server/Status/Data.php">
<MixedArgumentTypeCoercion>
<code>$filter</code>
<code>$name</code>
</MixedArgumentTypeCoercion>
<MixedArrayAccess>
<code><![CDATA[$usedQueries['Com_admin_commands']]]></code>
</MixedArrayAccess>
<MixedArrayOffset>
<code>$sectionUsed[$section]</code>
</MixedArrayOffset>
<MixedAssignment>
<code>$allocationMap[$name]</code>
<code>$keyReadRequests</code>
<code>$keyReads</code>
<code>$keyWriteRequests</code>
<code>$keyWrites</code>
<code>$section</code>
<code><![CDATA[$serverStatus['Key_buffer_fraction_%']]]></code>
<code><![CDATA[$serverStatus['Key_buffer_fraction_%']]]></code>
<code><![CDATA[$serverStatus['Key_read_ratio_%']]]></code>
<code><![CDATA[$serverStatus['Key_write_ratio_%']]]></code>
<code><![CDATA[$serverStatus['Threads_cache_hitrate_%']]]></code>
<code><![CDATA[$this->allocationMap]]></code>
<code><![CDATA[$this->sectionUsed]]></code>
<code><![CDATA[$this->usedQueries]]></code>
<code>$usedQueries[$name]</code>
<code>$value</code>
</MixedAssignment>
Expand All @@ -11029,13 +11016,6 @@
<PossiblyInvalidArgument>
<code><![CDATA[$_POST['primary_connection'] ?? null]]></code>
</PossiblyInvalidArgument>
<PossiblyUnusedMethod>
<code>__set</code>
</PossiblyUnusedMethod>
<PossiblyUnusedParam>
<code>$a</code>
<code>$b</code>
</PossiblyUnusedParam>
<UnusedProperty>
<code>$dbi</code>
</UnusedProperty>
Expand Down Expand Up @@ -13383,6 +13363,10 @@
<code>DatabaseInterface::getInstance()</code>
<code>DatabaseInterface::getInstance()</code>
</DeprecatedMethod>
<InaccessibleProperty>
<code><![CDATA[$this->data->dataLoaded]]></code>
<code><![CDATA[$this->data->dataLoaded]]></code>
</InaccessibleProperty>
</file>
<file src="tests/classes/Controllers/Server/Status/Monitor/GeneralLogControllerTest.php">
<DeprecatedMethod>
Expand Down Expand Up @@ -13447,6 +13431,10 @@
<code>Config::getInstance()</code>
<code>DatabaseInterface::getInstance()</code>
</DeprecatedMethod>
<InaccessibleProperty>
<code><![CDATA[$this->data->status]]></code>
<code><![CDATA[$this->data->usedQueries]]></code>
</InaccessibleProperty>
<MixedArgument>
<code>$totalQueries * $hourFactor</code>
<code><![CDATA[$totalQueries * 60 / $this->data->status['Uptime']]]></code>
Expand All @@ -13468,6 +13456,14 @@
<code>DatabaseInterface::getInstance()</code>
<code>DatabaseInterface::getInstance()</code>
</DeprecatedMethod>
<InaccessibleProperty>
<code><![CDATA[$data->status]]></code>
<code><![CDATA[$data->status]]></code>
<code><![CDATA[$data->status]]></code>
<code><![CDATA[$data->status]]></code>
<code><![CDATA[$data->status]]></code>
<code><![CDATA[$data->status]]></code>
</InaccessibleProperty>
</file>
<file src="tests/classes/Controllers/Server/Status/VariablesControllerTest.php">
<DeprecatedMethod>
Expand Down
Loading

0 comments on commit b53d63c

Please sign in to comment.