Skip to content

Commit

Permalink
Merge pull request phpmyadmin#19452 from kamil-tekiela/Status-Data-st…
Browse files Browse the repository at this point in the history
…atus

Refactor Status\Data class
  • Loading branch information
MauricioFauth authored Dec 17, 2024
2 parents ddc64a4 + 574bc91 commit ff8d5e2
Show file tree
Hide file tree
Showing 6 changed files with 152 additions and 253 deletions.
158 changes: 58 additions & 100 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3781,151 +3781,121 @@ parameters:
path: src/Controllers/Server/Status/Processes/KillController.php

-
message: '#^Binary operation "\*" between mixed and \(float\|int\) results in an error\.$#'
message: '#^Binary operation "\*" between float\|int and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/QueriesController.php

-
message: '#^Binary operation "\*" between mixed and 100 results in an error\.$#'
message: '#^Binary operation "\*" between float\|int\|string and 100 results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/QueriesController.php

-
message: '#^Binary operation "\+\=" between float\|int and mixed results in an error\.$#'
identifier: assignOp.invalid
message: '#^Binary operation "\*" between float\|int\|string and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/QueriesController.php

-
message: '#^Binary operation "/" between \(float\|int\) and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 2
message: '#^Binary operation "\+\=" between mixed and float\|int\|string results in an error\.$#'
identifier: assignOp.invalid
count: 1
path: src/Controllers/Server/Status/QueriesController.php

-
message: '#^Binary operation "/" between 3600 and mixed results in an error\.$#'
message: '#^Binary operation "/" between 3600 and float\|int\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/QueriesController.php

-
message: '#^Cannot cast mixed to int\.$#'
identifier: cast.int
count: 1
message: '#^Binary operation "/" between float\|int and float\|int\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 2
path: src/Controllers/Server/Status/QueriesController.php

-
message: '#^Parameter \#3 \$subject of function str_replace expects array\<string\>\|string, \(int\|string\) given\.$#'
identifier: argument.type
message: '#^Binary operation "/" between mixed and float\|int results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/QueriesController.php

-
message: '#^Binary operation "\*" between \(array\|float\|int\) and \(float\|int\) results in an error\.$#'
message: '#^Binary operation "\*" between float\|int\|string and 100 results in an error\.$#'
identifier: binaryOp.invalid
count: 1
count: 2
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Binary operation "\*" between mixed and \(float\|int\) results in an error\.$#'
message: '#^Binary operation "\*" between float\|int\|string and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 5
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Binary operation "\*" between mixed and 100 results in an error\.$#'
message: '#^Binary operation "\*" between mixed and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 2
count: 1
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Binary operation "\+" between mixed and mixed results in an error\.$#'
message: '#^Binary operation "\+" between float\|int\|string and float\|int\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 3
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Binary operation "\." between ''SELECT UNIX…'' and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Binary operation "/" between \(float\|int\) and mixed results in an error\.$#'
message: '#^Binary operation "/" between 3600 and float\|int\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 2
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Binary operation "/" between 3600 and mixed results in an error\.$#'
message: '#^Binary operation "/" between mixed and float\|int\<1, max\>\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 2
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Cannot cast mixed to int\.$#'
identifier: cast.int
count: 1
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Only booleans are allowed in an if condition, mixed given\.$#'
identifier: if.condNotBoolean
count: 2
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Only numeric types are allowed in \*, \(array\|float\|int\) given on the left side\.$#'
identifier: mul.leftNonNumeric
count: 1
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Parameter \#1 \$value of static method PhpMyAdmin\\Util\:\:formatByteDown\(\) expects float\|int\|string\|null, \(array\|float\|int\) given\.$#'
identifier: argument.type
count: 2
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Parameter \#1 \$value of static method PhpMyAdmin\\Util\:\:formatByteDown\(\) expects float\|int\|string\|null, mixed given\.$#'
identifier: argument.type
count: 2
count: 4
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Parameter \#1 \$value of static method PhpMyAdmin\\Util\:\:formatNumber\(\) expects float\|int\|string, mixed given\.$#'
identifier: argument.type
count: 4
count: 5
path: src/Controllers/Server/Status/StatusController.php

-
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
identifier: foreach.nonIterable
count: 1
path: src/Controllers/Server/Status/VariablesController.php

-
message: '#^Binary operation "\*" between 0\.01 and mixed results in an error\.$#'
message: '#^Binary operation "\*" between 0\.01 and float\|int\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/VariablesController.php

-
message: '#^Binary operation "\*" between 0\.9 and mixed results in an error\.$#'
message: '#^Binary operation "\*" between 0\.9 and float\|int\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/VariablesController.php

-
message: '#^Binary operation "\*" between 0\.95 and mixed results in an error\.$#'
message: '#^Binary operation "\*" between 0\.95 and string results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/VariablesController.php

-
message: '#^Binary operation "/" between mixed and 5 results in an error\.$#'
message: '#^Binary operation "/" between float\|int\|string and 5 results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Controllers/Server/Status/VariablesController.php
Expand All @@ -3942,18 +3912,6 @@ parameters:
count: 1
path: src/Controllers/Server/Status/VariablesController.php

-
message: '#^Parameter \#1 \$haystack of function str_contains expects string, \(int\|string\) given\.$#'
identifier: argument.type
count: 1
path: src/Controllers/Server/Status/VariablesController.php

-
message: '#^Parameter \#1 \$name of static method PhpMyAdmin\\Html\\Generator\:\:linkToVarDocumentation\(\) expects string, \(int\|string\) given\.$#'
identifier: argument.type
count: 1
path: src/Controllers/Server/Status/VariablesController.php

-
message: '#^Short ternary operator is not allowed\. Use null coalesce operator if applicable or consider using long ternary\.$#'
identifier: ternary.shortNotAllowed
Expand Down Expand Up @@ -16225,21 +16183,27 @@ parameters:
path: src/Server/Status/Data.php

-
message: '#^Binary operation "\*" between mixed and 1024 results in an error\.$#'
message: '#^Binary operation "\*" between mixed and 100 results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Server/Status/Data.php

-
message: '#^Binary operation "\*" between mixed and mixed results in an error\.$#'
message: '#^Binary operation "\*" between string and 1024 results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Server/Status/Data.php

-
message: '#^Binary operation "\*" between string and string results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: src/Server/Status/Data.php

-
message: '#^Binary operation "/" between \(float\|int\) and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 4
count: 2
path: src/Server/Status/Data.php

-
Expand All @@ -16248,6 +16212,12 @@ parameters:
count: 1
path: src/Server/Status/Data.php

-
message: '#^Binary operation "/" between mixed and string results in an error\.$#'
identifier: binaryOp.invalid
count: 2
path: src/Server/Status/Data.php

-
message: '#^Cannot access offset ''doc'' on mixed\.$#'
identifier: offsetAccess.nonOffsetAccessible
Expand All @@ -16266,6 +16236,12 @@ parameters:
count: 2
path: src/Server/Status/Data.php

-
message: '#^Method PhpMyAdmin\\Server\\Status\\Data\:\:calculateValues\(\) should return array\<string, float\|int\|string\> but returns array\<string, mixed\>\.$#'
identifier: return.type
count: 1
path: src/Server/Status/Data.php

-
message: '#^Only booleans are allowed in an if condition, mixed given\.$#'
identifier: if.condNotBoolean
Expand All @@ -16278,12 +16254,6 @@ parameters:
count: 1
path: src/Server/Status/Data.php

-
message: '#^Parameter \#1 \$haystack of function str_contains expects string, \(int\|string\) given\.$#'
identifier: argument.type
count: 1
path: src/Server/Status/Data.php

-
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
identifier: foreach.nonIterable
Expand Down Expand Up @@ -20271,19 +20241,13 @@ parameters:
count: 1
path: tests/unit/Controllers/Server/ShowEngineControllerTest.php

-
message: '#^@readonly property PhpMyAdmin\\Server\\Status\\Data\:\:\$dataLoaded is assigned outside of its declaring class\.$#'
identifier: property.readOnlyByPhpDocAssignOutOfClass
count: 2
path: tests/unit/Controllers/Server/Status/AdvisorControllerTest.php

-
message: '''
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\:
Use dependency injection instead\.$#
'''
identifier: staticMethod.deprecated
count: 1
count: 2
path: tests/unit/Controllers/Server/Status/AdvisorControllerTest.php

-
Expand Down Expand Up @@ -20467,25 +20431,19 @@ parameters:
path: tests/unit/Controllers/Server/Status/ProcessesControllerTest.php

-
message: '#^@readonly property PhpMyAdmin\\Server\\Status\\Data\:\:\$status is assigned outside of its declaring class\.$#'
identifier: property.readOnlyByPhpDocAssignOutOfClass
count: 1
path: tests/unit/Controllers/Server/Status/QueriesControllerTest.php

-
message: '#^@readonly property PhpMyAdmin\\Server\\Status\\Data\:\:\$usedQueries is assigned outside of its declaring class\.$#'
identifier: property.readOnlyByPhpDocAssignOutOfClass
message: '#^Binary operation "\*" between float\|int and mixed results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: tests/unit/Controllers/Server/Status/QueriesControllerTest.php

-
message: '#^Binary operation "/" between \(float\|int\) and mixed results in an error\.$#'
message: '#^Binary operation "/" between 3600 and float\|int\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: tests/unit/Controllers/Server/Status/QueriesControllerTest.php

-
message: '#^Binary operation "/" between 3600 and mixed results in an error\.$#'
message: '#^Binary operation "/" between float\|int and float\|int\|string results in an error\.$#'
identifier: binaryOp.invalid
count: 1
path: tests/unit/Controllers/Server/Status/QueriesControllerTest.php
Expand All @@ -20509,10 +20467,10 @@ parameters:
path: tests/unit/Controllers/Server/Status/QueriesControllerTest.php

-
message: '#^@readonly property PhpMyAdmin\\Server\\Status\\Data\:\:\$status is assigned outside of its declaring class\.$#'
identifier: property.readOnlyByPhpDocAssignOutOfClass
count: 6
path: tests/unit/Controllers/Server/Status/StatusControllerTest.php
message: '#^Parameter \#1 \$value of static method PhpMyAdmin\\Util\:\:formatNumber\(\) expects float\|int\|string, mixed given\.$#'
identifier: argument.type
count: 1
path: tests/unit/Controllers/Server/Status/QueriesControllerTest.php

-
message: '''
Expand All @@ -20529,7 +20487,7 @@ parameters:
Use dependency injection instead\.$#
'''
identifier: staticMethod.deprecated
count: 3
count: 2
path: tests/unit/Controllers/Server/Status/StatusControllerTest.php

-
Expand Down
Loading

0 comments on commit ff8d5e2

Please sign in to comment.