Merge pull request #18833 from kamil-tekiela/in_array

Various fixes to make in_array a strict check
This commit is contained in:
Maurício Meneghini Fauth 2023-12-07 21:59:57 -03:00 committed by GitHub
commit ed17c715db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 279 additions and 637 deletions

View File

@ -1115,11 +1115,6 @@ parameters:
count: 1
path: src/ConfigStorage/Relation.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/ConfigStorage/Relation.php
-
message: "#^Cannot access an offset on mixed\\.$#"
count: 1
@ -1680,11 +1675,6 @@ parameters:
count: 1
path: src/Controllers/Database/DataDictionaryController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Database/DesignerController.php
-
message: "#^Cannot access offset 'dbName' on mixed\\.$#"
count: 2
@ -2060,11 +2050,6 @@ parameters:
count: 1
path: src/Controllers/Database/MultiTableQueryController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Controllers/Database/RoutinesController.php
-
message: "#^Cannot access an offset on mixed\\.$#"
count: 6
@ -2187,7 +2172,7 @@ parameters:
-
message: "#^Parameter \\#3 \\$which of static method PhpMyAdmin\\\\Database\\\\Routines\\:\\:getDetails\\(\\) expects string\\|null, mixed given\\.$#"
count: 2
count: 1
path: src/Controllers/Database/RoutinesController.php
-
@ -2705,11 +2690,6 @@ parameters:
count: 4
path: src/Controllers/Database/StructureController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Controllers/Database/StructureController.php
-
message: "#^Cannot access offset 'Check_time' on mixed\\.$#"
count: 1
@ -3035,11 +3015,6 @@ parameters:
count: 1
path: src/Controllers/Database/TrackingController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/ErrorReportController.php
-
message: "#^Cannot access offset 'success' on mixed\\.$#"
count: 1
@ -3065,11 +3040,6 @@ parameters:
count: 1
path: src/Controllers/Export/ExportController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Export/ExportController.php
-
message: "#^Cannot access offset 'aliases' on mixed\\.$#"
count: 1
@ -3226,7 +3196,7 @@ parameters:
path: src/Controllers/Export/ExportController.php
-
message: "#^Parameter \\#2 \\$tables of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array, mixed given\\.$#"
message: "#^Parameter \\#2 \\$tables of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 2
path: src/Controllers/Export/ExportController.php
@ -3301,7 +3271,7 @@ parameters:
path: src/Controllers/Export/ExportController.php
-
message: "#^Parameter \\#4 \\$tableStructure of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array, mixed given\\.$#"
message: "#^Parameter \\#4 \\$tableStructure of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 2
path: src/Controllers/Export/ExportController.php
@ -3321,7 +3291,7 @@ parameters:
path: src/Controllers/Export/ExportController.php
-
message: "#^Parameter \\#5 \\$tableData of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array, mixed given\\.$#"
message: "#^Parameter \\#5 \\$tableData of method PhpMyAdmin\\\\Export\\\\Export\\:\\:exportDatabase\\(\\) expects array\\<string\\>, mixed given\\.$#"
count: 2
path: src/Controllers/Export/ExportController.php
@ -3440,11 +3410,6 @@ parameters:
count: 1
path: src/Controllers/Import/ImportController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Import/ImportController.php
-
message: "#^Cannot access offset 'error' on mixed\\.$#"
count: 1
@ -3552,7 +3517,7 @@ parameters:
-
message: "#^Parameter \\#1 \\$path of static method PhpMyAdmin\\\\Core\\:\\:securePath\\(\\) expects string, mixed given\\.$#"
count: 2
count: 1
path: src/Controllers/Import/ImportController.php
-
@ -4580,11 +4545,6 @@ parameters:
count: 4
path: src/Controllers/Server/DatabasesController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Server/DatabasesController.php
-
message: "#^Cannot access offset 'DEFAULT_COLLATION…' on mixed\\.$#"
count: 1
@ -5055,11 +5015,6 @@ parameters:
count: 1
path: src/Controllers/Server/Status/VariablesController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Server/Status/VariablesController.php
-
message: "#^Only booleans are allowed in a negated boolean, mixed given\\.$#"
count: 1
@ -5145,16 +5100,6 @@ parameters:
count: 1
path: src/Controllers/Server/Variables/SetVariableController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Server/VariablesController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Setup/AbstractController.php
-
message: "#^Only booleans are allowed in a ternary operator condition, mixed given\\.$#"
count: 1
@ -6590,11 +6535,6 @@ parameters:
count: 2
path: src/Controllers/Table/ReplaceController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Table/ReplaceController.php
-
message: "#^Call to function method_exists\\(\\) with PhpMyAdmin\\\\Plugins\\\\IOTransformationsPlugin and 'isSuccess' will always evaluate to true\\.$#"
count: 1
@ -6870,11 +6810,6 @@ parameters:
count: 1
path: src/Controllers/Table/ReplaceController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Controllers/Table/SearchController.php
-
message: "#^Cannot access offset int on mixed\\.$#"
count: 1
@ -7860,11 +7795,6 @@ parameters:
count: 2
path: src/Controllers/Table/ZoomSearchController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Controllers/Table/ZoomSearchController.php
-
message: "#^Cannot access offset 0 on mixed\\.$#"
count: 3
@ -8045,11 +7975,6 @@ parameters:
count: 1
path: src/Controllers/Transformation/WrapperController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Controllers/Triggers/IndexController.php
-
message: "#^Cannot call method isSuccess\\(\\) on mixed\\.$#"
count: 1
@ -8220,11 +8145,6 @@ parameters:
count: 1
path: src/Controllers/VersionCheckController.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Controllers/View/CreateController.php
-
message: "#^Cannot access offset 'back' on mixed\\.$#"
count: 1
@ -8325,11 +8245,6 @@ parameters:
count: 1
path: src/Core.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 4
path: src/Core.php
-
message: "#^Cannot access offset string on mixed\\.$#"
count: 8
@ -8400,11 +8315,6 @@ parameters:
count: 3
path: src/CreateAddField.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/CreateAddField.php
-
message: "#^Cannot access offset 'col_index' on mixed\\.$#"
count: 1
@ -8557,7 +8467,7 @@ parameters:
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 9
count: 4
path: src/Database/CentralColumns.php
-
@ -8840,11 +8750,6 @@ parameters:
count: 3
path: src/Database/Designer/Common.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Database/Designer/Common.php
-
message: "#^Cannot access offset 'ENGINE' on mixed\\.$#"
count: 5
@ -9005,11 +8910,6 @@ parameters:
count: 1
path: src/Database/Events.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Database/Events.php
-
message: "#^Cannot access an offset on mixed\\.$#"
count: 6
@ -9095,14 +8995,9 @@ parameters:
count: 3
path: src/Database/Routines.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 9
path: src/Database/Routines.php
-
message: "#^Cannot access an offset on mixed\\.$#"
count: 10
count: 9
path: src/Database/Routines.php
-
@ -9195,6 +9090,11 @@ parameters:
count: 1
path: src/Database/Routines.php
-
message: "#^Cannot assign new offset to array\\<int, string\\>\\|string\\|null\\.$#"
count: 1
path: src/Database/Routines.php
-
message: "#^Cannot call method has\\(\\) on PhpMyAdmin\\\\SqlParser\\\\Components\\\\OptionsArray\\|null\\.$#"
count: 1
@ -9207,7 +9107,7 @@ parameters:
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 24
count: 22
path: src/Database/Routines.php
-
@ -9355,11 +9255,6 @@ parameters:
count: 3
path: src/Database/Routines.php
-
message: "#^Parameter \\#3 \\.\\.\\.\\$values of function sprintf expects bool\\|float\\|int\\|string\\|null, mixed given\\.$#"
count: 1
path: src/Database/Routines.php
-
message: "#^Parameter \\#7 \\$itemType of method PhpMyAdmin\\\\Database\\\\Routines\\:\\:processParamsAndBuild\\(\\) expects string, mixed given\\.$#"
count: 1
@ -9645,11 +9540,6 @@ parameters:
count: 6
path: src/Display/Results.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Display/Results.php
-
message: "#^Cannot access offset 'display_binary' on mixed\\.$#"
count: 8
@ -10095,11 +9985,6 @@ parameters:
count: 3
path: src/Error.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Error.php
-
message: "#^Cannot access offset 'args' on mixed\\.$#"
count: 1
@ -10267,7 +10152,7 @@ parameters:
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 5
count: 1
path: src/Export/Export.php
-
@ -10332,12 +10217,7 @@ parameters:
-
message: "#^Parameter \\#1 \\$identifier of static method PhpMyAdmin\\\\Util\\:\\:backquote\\(\\) expects string\\|Stringable\\|null, mixed given\\.$#"
count: 2
path: src/Export/Export.php
-
message: "#^Parameter \\#1 \\$name of class PhpMyAdmin\\\\Table\\\\Table constructor expects string, mixed given\\.$#"
count: 2
count: 1
path: src/Export/Export.php
-
@ -10345,11 +10225,6 @@ parameters:
count: 2
path: src/Export/Export.php
-
message: "#^Parameter \\#1 \\$str of method PhpMyAdmin\\\\DatabaseInterface\\:\\:quoteString\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Export/Export.php
-
message: "#^Parameter \\#1 \\$stream of function fwrite expects resource, mixed given\\.$#"
count: 2
@ -10370,21 +10245,6 @@ parameters:
count: 1
path: src/Export/Export.php
-
message: "#^Parameter \\#2 \\$table of method PhpMyAdmin\\\\Plugins\\\\ExportPlugin\\:\\:exportData\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/Export/Export.php
-
message: "#^Parameter \\#2 \\$table of method PhpMyAdmin\\\\Plugins\\\\ExportPlugin\\:\\:exportStructure\\(\\) expects string, mixed given\\.$#"
count: 4
path: src/Export/Export.php
-
message: "#^Parameter \\#2 \\$tables of method PhpMyAdmin\\\\Plugins\\\\ExportPlugin\\:\\:exportMetadata\\(\\) expects array\\<string\\>\\|string, array given\\.$#"
count: 1
path: src/Export/Export.php
-
message: "#^Parameter \\#3 \\$dbAlias of method PhpMyAdmin\\\\Plugins\\\\ExportPlugin\\:\\:exportDBCreate\\(\\) expects string, mixed given\\.$#"
count: 1
@ -10580,11 +10440,6 @@ parameters:
count: 1
path: src/Font.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Footer.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 4
@ -10945,11 +10800,6 @@ parameters:
count: 1
path: src/Gis/GisVisualization.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Git.php
-
message: "#^Cannot access offset 1 on array\\|false\\.$#"
count: 2
@ -11117,7 +10967,7 @@ parameters:
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
count: 1
path: src/Html/Generator.php
-
@ -11730,11 +11580,6 @@ parameters:
count: 2
path: src/InsertEdit.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 8
path: src/InsertEdit.php
-
message: "#^Cannot access offset 'relational_display' on mixed\\.$#"
count: 1
@ -12045,11 +11890,6 @@ parameters:
count: 1
path: src/IpAllowDeny.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Language.php
-
message: "#^Cannot access offset 'a_meta_dir' on mixed\\.$#"
count: 1
@ -12180,11 +12020,6 @@ parameters:
count: 1
path: src/Menu.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 5
path: src/Menu.php
-
message: "#^Cannot access offset 'icon' on mixed\\.$#"
count: 22
@ -12280,11 +12115,6 @@ parameters:
count: 1
path: src/Navigation/NavigationTree.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 12
path: src/Navigation/NavigationTree.php
-
message: "#^Cannot access offset 'image' on mixed\\.$#"
count: 1
@ -12465,11 +12295,6 @@ parameters:
count: 1
path: src/Navigation/Nodes/Node.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Navigation/Nodes/Node.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 5
@ -12535,11 +12360,6 @@ parameters:
count: 1
path: src/Navigation/Nodes/NodeColumn.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Navigation/Nodes/NodeDatabase.php
-
message: "#^Method PhpMyAdmin\\\\Navigation\\\\Nodes\\\\NodeDatabase\\:\\:getEventCount\\(\\) should return int but returns int\\|string\\.$#"
count: 1
@ -12587,7 +12407,7 @@ parameters:
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 7
count: 1
path: src/Normalization.php
-
@ -13375,11 +13195,6 @@ parameters:
count: 1
path: src/Plugins/Auth/AuthenticationHttp.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Plugins/Auth/AuthenticationSignon.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 2
@ -13520,11 +13335,6 @@ parameters:
count: 3
path: src/Plugins/Export/ExportCsv.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Plugins/Export/ExportHtmlword.php
-
message: "#^Cannot access offset 'columns' on mixed\\.$#"
count: 3
@ -13575,11 +13385,6 @@ parameters:
count: 1
path: src/Plugins/Export/ExportJson.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Plugins/Export/ExportLatex.php
-
message: "#^Cannot access offset 'columns' on mixed\\.$#"
count: 2
@ -14170,11 +13975,6 @@ parameters:
count: 1
path: src/Plugins/Export/ExportSql.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Plugins/Export/ExportTexytext.php
-
message: "#^Cannot access offset 'columns' on mixed\\.$#"
count: 3
@ -15195,11 +14995,6 @@ parameters:
count: 2
path: src/Plugins/Schema/Dia/DiaRelationSchema.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Plugins/Schema/Dia/DiaRelationSchema.php
-
message: "#^Cannot access offset 'foreign_field' on mixed\\.$#"
count: 1
@ -15207,7 +15002,7 @@ parameters:
-
message: "#^Cannot access offset 'foreign_table' on mixed\\.$#"
count: 2
count: 1
path: src/Plugins/Schema/Dia/DiaRelationSchema.php
-
@ -15222,7 +15017,7 @@ parameters:
-
message: "#^Cannot access offset 'ref_table_name' on mixed\\.$#"
count: 2
count: 1
path: src/Plugins/Schema/Dia/DiaRelationSchema.php
-
@ -15245,11 +15040,6 @@ parameters:
count: 1
path: src/Plugins/Schema/Dia/DiaRelationSchema.php
-
message: "#^Parameter \\#3 \\$foreignTable of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Dia\\\\DiaRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
count: 2
path: src/Plugins/Schema/Dia/DiaRelationSchema.php
-
message: "#^Parameter \\#4 \\$foreignField of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Dia\\\\DiaRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
count: 2
@ -15280,11 +15070,6 @@ parameters:
count: 2
path: src/Plugins/Schema/Eps/EpsRelationSchema.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Plugins/Schema/Eps/EpsRelationSchema.php
-
message: "#^Cannot access offset 'foreign_field' on mixed\\.$#"
count: 1
@ -15292,7 +15077,7 @@ parameters:
-
message: "#^Cannot access offset 'foreign_table' on mixed\\.$#"
count: 2
count: 1
path: src/Plugins/Schema/Eps/EpsRelationSchema.php
-
@ -15307,7 +15092,7 @@ parameters:
-
message: "#^Cannot access offset 'ref_table_name' on mixed\\.$#"
count: 2
count: 1
path: src/Plugins/Schema/Eps/EpsRelationSchema.php
-
@ -15330,11 +15115,6 @@ parameters:
count: 1
path: src/Plugins/Schema/Eps/EpsRelationSchema.php
-
message: "#^Parameter \\#5 \\$foreignTable of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\EpsRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
count: 2
path: src/Plugins/Schema/Eps/EpsRelationSchema.php
-
message: "#^Parameter \\#6 \\$foreignField of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\EpsRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
count: 2
@ -15415,11 +15195,6 @@ parameters:
count: 2
path: src/Plugins/Schema/Pdf/PdfRelationSchema.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Plugins/Schema/Pdf/PdfRelationSchema.php
-
message: "#^Call to method TCPDF\\:\\:Line\\(\\) with incorrect case\\: line$#"
count: 2
@ -15457,7 +15232,7 @@ parameters:
-
message: "#^Cannot access offset 'foreign_table' on mixed\\.$#"
count: 2
count: 1
path: src/Plugins/Schema/Pdf/PdfRelationSchema.php
-
@ -15472,7 +15247,7 @@ parameters:
-
message: "#^Cannot access offset 'ref_table_name' on mixed\\.$#"
count: 2
count: 1
path: src/Plugins/Schema/Pdf/PdfRelationSchema.php
-
@ -15565,11 +15340,6 @@ parameters:
count: 1
path: src/Plugins/Schema/Pdf/PdfRelationSchema.php
-
message: "#^Parameter \\#3 \\$foreignTable of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\PdfRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
count: 2
path: src/Plugins/Schema/Pdf/PdfRelationSchema.php
-
message: "#^Parameter \\#4 \\$foreignField of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\PdfRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
count: 2
@ -15645,11 +15415,6 @@ parameters:
count: 2
path: src/Plugins/Schema/Svg/SvgRelationSchema.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/Plugins/Schema/Svg/SvgRelationSchema.php
-
message: "#^Cannot access offset 'foreign_field' on mixed\\.$#"
count: 1
@ -15657,7 +15422,7 @@ parameters:
-
message: "#^Cannot access offset 'foreign_table' on mixed\\.$#"
count: 2
count: 1
path: src/Plugins/Schema/Svg/SvgRelationSchema.php
-
@ -15672,7 +15437,7 @@ parameters:
-
message: "#^Cannot access offset 'ref_table_name' on mixed\\.$#"
count: 2
count: 1
path: src/Plugins/Schema/Svg/SvgRelationSchema.php
-
@ -15690,11 +15455,6 @@ parameters:
count: 1
path: src/Plugins/Schema/Svg/SvgRelationSchema.php
-
message: "#^Parameter \\#5 \\$foreignTable of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\SvgRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
count: 2
path: src/Plugins/Schema/Svg/SvgRelationSchema.php
-
message: "#^Parameter \\#6 \\$foreignField of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\SvgRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
count: 2
@ -16015,11 +15775,6 @@ parameters:
count: 1
path: src/Profiling.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Query/Compatibility.php
-
message: "#^Cannot access offset 'AUTO_INCREMENT' on mixed\\.$#"
count: 1
@ -16455,11 +16210,6 @@ parameters:
count: 1
path: src/Replication/Replication.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Replication/ReplicationGui.php
-
message: "#^Cannot access offset 'Slave_IO_Running' on mixed\\.$#"
count: 1
@ -16750,11 +16500,6 @@ parameters:
count: 1
path: src/Server/Privileges.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 17
path: src/Server/Privileges.php
-
message: "#^Cannot access offset 'CHARACTER_MAXIMUM…' on mixed\\.$#"
count: 2
@ -17385,11 +17130,6 @@ parameters:
count: 1
path: src/Server/SysInfo/SunOs.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Server/SysInfo/SysInfo.php
-
message: "#^Class COM referenced with incorrect case\\: com\\.$#"
count: 1
@ -17930,11 +17670,6 @@ parameters:
count: 4
path: src/SystemDatabase.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Table/ColumnsDefinition.php
-
message: "#^Cannot access offset 'isEditable' on mixed\\.$#"
count: 2
@ -18085,11 +17820,6 @@ parameters:
count: 2
path: src/Table/Search.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Table/Search.php
-
message: "#^Cannot access offset mixed on mixed\\.$#"
count: 4
@ -18177,7 +17907,7 @@ parameters:
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 5
count: 3
path: src/Table/Table.php
-
@ -18655,11 +18385,6 @@ parameters:
count: 1
path: src/Tracking/Tracker.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 4
path: src/Tracking/Tracking.php
-
message: "#^Cannot access offset 'COLUMNS' on mixed\\.$#"
count: 1
@ -18780,11 +18505,6 @@ parameters:
count: 1
path: src/Triggers/Triggers.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: src/Triggers/Triggers.php
-
message: "#^Cannot access an offset on mixed\\.$#"
count: 6
@ -18827,7 +18547,7 @@ parameters:
-
message: "#^Parameter \\#1 \\$identifier of static method PhpMyAdmin\\\\Util\\:\\:backquote\\(\\) expects string\\|Stringable\\|null, mixed given\\.$#"
count: 4
count: 3
path: src/Triggers/Triggers.php
-
@ -18855,21 +18575,6 @@ parameters:
count: 1
path: src/Triggers/Triggers.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: src/TwoFactor.php
-
message: "#^Parameter \\#1 \\$name of method PhpMyAdmin\\\\TwoFactor\\:\\:getBackendClass\\(\\) expects string, mixed given\\.$#"
count: 1
path: src/TwoFactor.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 1
path: src/Types.php
-
message: "#^Construct empty\\(\\) is not allowed\\. Use more strict comparison\\.$#"
count: 4
@ -19005,11 +18710,6 @@ parameters:
count: 1
path: src/Util.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 6
path: src/Util.php
-
message: "#^Cannot access offset 'Cardinality' on mixed\\.$#"
count: 1
@ -19370,11 +19070,6 @@ parameters:
count: 1
path: src/ZipExtension.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 2
path: tests/classes/AbstractTestCase.php
-
message: "#^Call to method PHPUnit\\\\Framework\\\\Assert\\:\\:assertArrayHasKey\\(\\) with 'formula' and array\\{id\\: non\\-empty\\-string, name\\: string, precondition\\?\\: non\\-empty\\-string, formula\\: non\\-empty\\-string, test\\: non\\-empty\\-string, issue\\: string, recommendation\\: string, justification\\: string, \\.\\.\\.\\} will always evaluate to true\\.$#"
count: 1
@ -21110,11 +20805,6 @@ parameters:
count: 1
path: tests/classes/Triggers/TriggersTest.php
-
message: "#^Call to function in_array\\(\\) requires parameter \\#3 to be set\\.$#"
count: 3
path: tests/classes/TwoFactorTest.php
-
message: "#^Method PhpMyAdmin\\\\Tests\\\\TwoFactorTest\\:\\:loadResultForConfig\\(\\) has parameter \\$config with no value type specified in iterable type array\\.$#"
count: 1

View File

@ -1243,7 +1243,6 @@
<code><![CDATA[$_POST['item_type']]]></code>
<code><![CDATA[$_POST['item_type']]]></code>
<code><![CDATA[$_REQUEST['item_name']]]></code>
<code>$type</code>
</PossiblyInvalidArgument>
<PossiblyInvalidCast>
<code><![CDATA[$_GET['item_name']]]></code>
@ -2079,7 +2078,6 @@
<code><![CDATA[$GLOBALS['timestamp']]]></code>
</InvalidArrayOffset>
<MixedArgument>
<code><![CDATA[$GLOBALS['format']]]></code>
<code><![CDATA[$GLOBALS['import_file']]]></code>
<code><![CDATA[$GLOBALS['import_file']]]></code>
<code><![CDATA[$GLOBALS['import_notice']]]></code>
@ -2154,7 +2152,6 @@
</MixedMethodCall>
<MixedOperand>
<code><![CDATA[$GLOBALS['charset_of_file']]]></code>
<code><![CDATA[$GLOBALS['format']]]></code>
<code><![CDATA[$GLOBALS['local_import_file']]]></code>
</MixedOperand>
<PossiblyInvalidArgument>
@ -3828,7 +3825,6 @@
<code><![CDATA[$GLOBALS['query']]]></code>
<code><![CDATA[$GLOBALS['unsaved_values']]]></code>
<code><![CDATA[$GLOBALS['unsaved_values'][$rowNumber]]]></code>
<code><![CDATA[$GLOBALS['urlParams']['after_insert']]]></code>
<code><![CDATA[$GLOBALS['urlParams']['where_clause'][]]]></code>
<code>$afterInsert</code>
<code>$clauseIsUnique</code>
@ -4418,11 +4414,8 @@
<code><![CDATA[$viewData['with']]]></code>
</MixedAssignment>
<MixedOperand>
<code><![CDATA[$view['algorithm']]]></code>
<code><![CDATA[$view['as']]]></code>
<code><![CDATA[$view['column_names']]]></code>
<code><![CDATA[$view['sql_security']]]></code>
<code><![CDATA[$view['with']]]></code>
</MixedOperand>
<PossiblyUnusedMethod>
<code>__construct</code>
@ -4540,7 +4533,6 @@
</MixedAssignment>
<MixedOperand>
<code><![CDATA[$column['size']]]></code>
<code><![CDATA[$index['Index_type']]]></code>
<code><![CDATA[$partition['comment']]]></code>
<code><![CDATA[$partition['data_directory']]]></code>
<code><![CDATA[$partition['engine']]]></code>
@ -5034,7 +5026,6 @@
</PossiblyInvalidCast>
<PossiblyInvalidOperand>
<code><![CDATA[$_POST['item_definition']]]></code>
<code><![CDATA[$_POST['item_interval_field']]]></code>
</PossiblyInvalidOperand>
<PossiblyNullArgument>
<code>$createItem</code>
@ -5152,7 +5143,6 @@
<code><![CDATA[$GLOBALS['errors'][]]]></code>
<code><![CDATA[$GLOBALS['errors'][]]]></code>
<code><![CDATA[$GLOBALS['errors'][]]]></code>
<code><![CDATA[$params[$i]['htmlentities'][]]]></code>
<code><![CDATA[$routine['item_param_name'][$i]]]></code>
</MixedArrayAssignment>
<MixedArrayOffset>
@ -5248,8 +5238,6 @@
<code><![CDATA[$_POST['item_returnlength']]]></code>
<code><![CDATA[$_POST['item_type']]]></code>
<code>$itemDefinition</code>
<code>$itemReturnType</code>
<code>$itemSqlDataAccess</code>
</PossiblyInvalidOperand>
<PossiblyNullArgument>
<code>$createRoutine</code>
@ -5954,11 +5942,9 @@
<code>$dbAlias</code>
<code>$dbAlias</code>
<code>$table</code>
<code>$table</code>
</MixedArgument>
<MixedArgumentTypeCoercion>
<code>$dbSelect</code>
<code>$tables</code>
</MixedArgumentTypeCoercion>
<MixedArrayAccess>
<code><![CDATA[$aliases[$db->getName()]['alias']]]></code>
@ -5989,7 +5975,6 @@
<code>$dbAlias</code>
<code>$dbAlias</code>
<code>$table</code>
<code>$table</code>
<code>$tableName</code>
<code>$tbl</code>
<code>$val</code>
@ -7483,9 +7468,6 @@
<code>int</code>
<code>int</code>
</InvalidReturnType>
<MixedAssignment>
<code>$item</code>
</MixedAssignment>
</file>
<file src="src/Navigation/Nodes/NodeDatabaseChild.php">
<PossiblyInvalidPropertyFetch>
@ -12351,15 +12333,12 @@
<code><![CDATA[$_POST['item_name']]]></code>
<code><![CDATA[$_POST['item_name']]]></code>
<code><![CDATA[$_POST['item_original_name']]]></code>
<code><![CDATA[$_POST['item_table']]]></code>
</PossiblyInvalidArgument>
<PossiblyInvalidCast>
<code><![CDATA[$_POST['item_original_name']]]></code>
</PossiblyInvalidCast>
<PossiblyInvalidOperand>
<code><![CDATA[$_POST['item_definition']]]></code>
<code><![CDATA[$_POST['item_event']]]></code>
<code><![CDATA[$_POST['item_timing']]]></code>
</PossiblyInvalidOperand>
<PossiblyNullReference>
<code>getCreateSql</code>
@ -12373,12 +12352,6 @@
<code>Config::getInstance()</code>
<code>DatabaseInterface::getInstance()</code>
</DeprecatedMethod>
<MixedArgument>
<code>$name</code>
</MixedArgument>
<MixedAssignment>
<code>$name</code>
</MixedAssignment>
<UnsafeInstantiation>
<code>new $cls($this)</code>
<code>new $cls($this)</code>

View File

@ -351,7 +351,7 @@ class Config
* Parses the configuration file, we throw away any errors or
* output.
*/
$canUseErrorReporting = Util::isErrorReportingAvailable();
$canUseErrorReporting = function_exists('error_reporting');
$oldErrorReporting = null;
if ($canUseErrorReporting) {
$oldErrorReporting = error_reporting(0);

View File

@ -1519,7 +1519,7 @@ class Relation
// Check if the table already exists
// use the possible replaced name first and fallback on the table name
// if no replacement exists
if (! in_array($tableNameReplacements[$table] ?? $table, $existingTables)) {
if (! in_array($tableNameReplacements[$table] ?? $table, $existingTables, true)) {
if (! $create) {
continue;
}

View File

@ -197,7 +197,7 @@ class DesignerController extends AbstractController
}
foreach ($tablePositions as $position) {
if (in_array($position['dbName'] . '.' . $position['tableName'], $fullTableNames)) {
if (in_array($position['dbName'] . '.' . $position['tableName'], $fullTableNames, true)) {
continue;
}

View File

@ -64,7 +64,10 @@ class RoutinesController extends AbstractController
/**
* Displays the header and tabs
*/
if (! empty($GLOBALS['table']) && in_array($GLOBALS['table'], $this->dbi->getTables($GLOBALS['db']))) {
if (
! empty($GLOBALS['table'])
&& in_array($GLOBALS['table'], $this->dbi->getTables($GLOBALS['db']), true)
) {
if (! $this->checkParameters(['db', 'table'])) {
return;
}
@ -452,7 +455,7 @@ class RoutinesController extends AbstractController
}
}
if (! isset($type) || ! in_array($type, ['FUNCTION', 'PROCEDURE'])) {
if (! isset($type) || ! in_array($type, ['FUNCTION', 'PROCEDURE'], true)) {
$type = null;
}

View File

@ -557,7 +557,7 @@ class StructureController extends AbstractController
if (isset($currentTable['TABLE_ROWS']) && ($currentTable['ENGINE'] != null || $tableIsView)) {
// InnoDB/TokuDB table: we did not get an accurate row count
$approxRows = ! $tableIsView
&& in_array($currentTable['ENGINE'], ['InnoDB', 'TokuDB'])
&& in_array($currentTable['ENGINE'], ['InnoDB', 'TokuDB'], true)
&& ! $currentTable['COUNTED'];
if ($tableIsView && $currentTable['TABLE_ROWS'] >= Config::getInstance()->settings['MaxExactCountViews']) {
@ -828,7 +828,7 @@ class StructureController extends AbstractController
$formattedSize = $unit = '';
if (
(in_array($currentTable['ENGINE'], ['InnoDB', 'TokuDB'])
(in_array($currentTable['ENGINE'], ['InnoDB', 'TokuDB'], true)
&& $currentTable['TABLE_ROWS'] < Config::getInstance()->settings['MaxExactCount'])
|| ! isset($currentTable['TABLE_ROWS'])
) {

View File

@ -48,7 +48,7 @@ class ErrorReportController extends AbstractController
/** @var string|null $alwaysSend */
$alwaysSend = $request->getParsedBodyParam('always_send');
if (! in_array($exceptionType, ['js', 'php'])) {
if (! in_array($exceptionType, ['js', 'php'], true)) {
return;
}

View File

@ -153,7 +153,7 @@ final class ExportController extends AbstractController
$separateFiles = $asSeparateFiles;
}
if (in_array($compressionParam, $compressionMethods)) {
if (in_array($compressionParam, $compressionMethods, true)) {
$GLOBALS['compression'] = $compressionParam;
$GLOBALS['buffer_needed'] = true;
}

View File

@ -229,7 +229,7 @@ final class ImportController extends AbstractController
* We only need to load the selected plugin
*/
if (! in_array($GLOBALS['format'], ['csv', 'ldi', 'mediawiki', 'ods', 'shp', 'sql', 'xml'])) {
if (! in_array($GLOBALS['format'], ['csv', 'ldi', 'mediawiki', 'ods', 'shp', 'sql', 'xml'], true)) {
// this should not happen for a normal user
// but only during an attack
$this->response->setRequestStatus(false);

View File

@ -182,7 +182,7 @@ class DatabasesController extends AbstractController
'SCHEMA_DATA_FREE',
];
$this->sortBy = 'SCHEMA_NAME';
if (in_array($sortBy, $sortByAllowList)) {
if (in_array($sortBy, $sortByAllowList, true)) {
$this->sortBy = $sortBy;
}
}

View File

@ -136,9 +136,7 @@ class VariablesController extends AbstractController
*/
private function flush(string $flush): void
{
$flushCommands = ['STATUS', 'TABLES', 'QUERY CACHE'];
if (! in_array($flush, $flushCommands)) {
if (! in_array($flush, ['STATUS', 'TABLES', 'QUERY CACHE'], true)) {
return;
}

View File

@ -73,7 +73,7 @@ class VariablesController extends AbstractController
$variables[] = [
'name' => $name,
'is_editable' => ! in_array(strtolower($name), $staticVariables),
'is_editable' => ! in_array(strtolower($name), $staticVariables, true),
'doc_link' => $docLink,
'value' => $formattedValue,
'is_escaped' => $isEscaped,

View File

@ -23,7 +23,7 @@ abstract class AbstractController
$ignored = ['Config', 'Servers'];
$pages = [];
foreach (SetupFormList::getAllFormNames() as $formset) {
if (in_array($formset, $ignored)) {
if (in_array($formset, $ignored, true)) {
continue;
}

View File

@ -76,9 +76,8 @@ final class ReplaceController extends AbstractController
$this->addScriptFiles(['makegrid.js', 'sql.js', 'gis_data_editor.js']);
$afterInsertActions = ['new_insert', 'same_insert', 'edit_next'];
$afterInsert = $request->getParsedBodyParam('after_insert');
if ($afterInsert !== null && in_array($afterInsert, $afterInsertActions)) {
if (in_array($afterInsert, ['new_insert', 'same_insert', 'edit_next'], true)) {
$GLOBALS['urlParams']['after_insert'] = $afterInsert;
$whereClause = $request->getParsedBodyParam('where_clause');
if ($whereClause !== null) {

View File

@ -120,7 +120,7 @@ class SearchController extends AbstractController
// before any replacement
$this->originalColumnTypes[] = mb_strtolower($type);
// check whether table contains geometric columns
if (in_array($type, $geomTypes)) {
if (in_array($type, $geomTypes, true)) {
$this->geomColumnFlag = true;
}
@ -378,8 +378,8 @@ class SearchController extends AbstractController
'',
);
$htmlAttributes = '';
$isInteger = in_array($cleanType, $this->dbi->types->getIntegerTypes());
$isFloat = in_array($cleanType, $this->dbi->types->getFloatTypes());
$isInteger = in_array($cleanType, $this->dbi->types->getIntegerTypes(), true);
$isFloat = in_array($cleanType, $this->dbi->types->getFloatTypes(), true);
if ($isInteger) {
$extractedColumnspec = Util::extractColumnSpec($this->originalColumnTypes[$columnIndex]);
$isUnsigned = $extractedColumnspec['unsigned'];

View File

@ -147,9 +147,9 @@ class StructureController extends AbstractController
/**
* Displays the table structure ('show table' works correct since 3.23.03)
*
* @param mixed[] $columnsWithUniqueIndex Columns with unique index
* @param ColumnFull[] $fields Fields
* @param mixed[] $columnsWithIndex Columns with index
* @param (string|int)[] $columnsWithUniqueIndex Columns with unique index
* @param ColumnFull[] $fields Fields
* @param (string|int)[] $columnsWithIndex Columns with index
* @psalm-param non-empty-string $route
*/
protected function displayStructure(

View File

@ -206,7 +206,7 @@ class ZoomSearchController extends AbstractController
// before any replacement
$this->originalColumnTypes[] = mb_strtolower($type);
// check whether table contains geometric columns
if (in_array($type, $geomTypes)) {
if (in_array($type, $geomTypes, true)) {
$this->geomColumnFlag = true;
}
@ -465,8 +465,8 @@ class ZoomSearchController extends AbstractController
'',
);
$htmlAttributes = '';
$isInteger = in_array($cleanType, $this->dbi->types->getIntegerTypes());
$isFloat = in_array($cleanType, $this->dbi->types->getFloatTypes());
$isInteger = in_array($cleanType, $this->dbi->types->getIntegerTypes(), true);
$isFloat = in_array($cleanType, $this->dbi->types->getFloatTypes(), true);
if ($isInteger) {
$extractedColumnspec = Util::extractColumnSpec($this->originalColumnTypes[$columnIndex]);
$isUnsigned = $extractedColumnspec['unsigned'];

View File

@ -57,7 +57,10 @@ final class IndexController extends AbstractController
/**
* Displays the header and tabs
*/
if (! empty($GLOBALS['table']) && in_array($GLOBALS['table'], $this->dbi->getTables($GLOBALS['db']))) {
if (
! empty($GLOBALS['table'])
&& in_array($GLOBALS['table'], $this->dbi->getTables($GLOBALS['db']), true)
) {
if (! $this->checkParameters(['db', 'table'])) {
return;
}

View File

@ -265,7 +265,7 @@ class CreateController extends AbstractController
if (
isset($view['algorithm'])
&& in_array($view['algorithm'], self::VIEW_ALGORITHM_OPTIONS)
&& in_array($view['algorithm'], self::VIEW_ALGORITHM_OPTIONS, true)
) {
$sqlQuery .= $separator . ' ALGORITHM = ' . $view['algorithm'];
}
@ -283,7 +283,7 @@ class CreateController extends AbstractController
if (
isset($view['sql_security'])
&& in_array($view['sql_security'], self::VIEW_SECURITY_OPTIONS)
&& in_array($view['sql_security'], self::VIEW_SECURITY_OPTIONS, true)
) {
$sqlQuery .= $separator . ' SQL SECURITY '
. $view['sql_security'];
@ -298,7 +298,7 @@ class CreateController extends AbstractController
$sqlQuery .= $separator . ' AS ' . $view['as'];
if (isset($view['with']) && in_array($view['with'], self::VIEW_WITH_OPTIONS)) {
if (isset($view['with']) && in_array($view['with'], self::VIEW_WITH_OPTIONS, true)) {
$sqlQuery .= $separator . ' WITH ' . $view['with'] . ' CHECK OPTION';
}

View File

@ -85,7 +85,7 @@ class Core
$phpDocLanguages = ['pt_BR', 'zh_CN', 'fr', 'de', 'ja', 'ru', 'es', 'tr'];
$lang = 'en';
if (isset($GLOBALS['lang']) && in_array($GLOBALS['lang'], $phpDocLanguages)) {
if (isset($GLOBALS['lang']) && in_array($GLOBALS['lang'], $phpDocLanguages, true)) {
$lang = $GLOBALS['lang'] === 'zh_CN' ? 'zh' : $GLOBALS['lang'];
}
@ -157,37 +157,25 @@ class Core
}
/**
* Checks given $page against given $allowList and returns true if valid
* it optionally ignores query parameters in $page (script.php?ignored)
*
* @param string $page page to check
* @param mixed[] $allowList allow list to check page against
* @param bool $include whether the page is going to be included
* Checks if the given $page is index.php and returns true if valid.
* It ignores query parameters in $page (script.php?ignored)
*/
public static function checkPageValidity(string $page, array $allowList = [], bool $include = false): bool
public static function checkPageValidity(string $page): bool
{
if ($allowList === []) {
$allowList = ['index.php'];
}
if ($page === '') {
return false;
}
if (in_array($page, $allowList)) {
if ($page === 'index.php') {
return true;
}
if ($include) {
return false;
}
$newPage = mb_substr(
$page,
0,
(int) mb_strpos($page . '?', '?'),
);
if (in_array($newPage, $allowList)) {
if ($newPage === 'index.php') {
return true;
}
@ -198,7 +186,7 @@ class Core
(int) mb_strpos($newPage . '?', '?'),
);
return in_array($newPage, $allowList);
return $newPage === 'index.php';
}
/**

View File

@ -173,7 +173,7 @@ class CreateAddField
if (
$index['Index_choice'] !== 'SPATIAL'
&& $index['Index_choice'] !== 'FULLTEXT'
&& in_array($index['Index_type'], Index::getIndexTypes())
&& in_array($index['Index_type'], Index::getIndexTypes(), true)
) {
$sqlQuery .= ' USING ' . $index['Index_type'];
}

View File

@ -752,19 +752,19 @@ class CentralColumns
foreach ($columnsList as &$row) {
$vals = explode(',', $row['col_extra']);
if (in_array('BINARY', $vals)) {
if (in_array('BINARY', $vals, true)) {
$row['col_attribute'] = 'BINARY';
} elseif (in_array('UNSIGNED', $vals)) {
} elseif (in_array('UNSIGNED', $vals, true)) {
$row['col_attribute'] = 'UNSIGNED';
} elseif (in_array('UNSIGNED ZEROFILL', $vals)) {
} elseif (in_array('UNSIGNED ZEROFILL', $vals, true)) {
$row['col_attribute'] = 'UNSIGNED ZEROFILL';
} elseif (in_array('on update CURRENT_TIMESTAMP', $vals)) {
} elseif (in_array('on update CURRENT_TIMESTAMP', $vals, true)) {
$row['col_attribute'] = 'on update CURRENT_TIMESTAMP';
} else {
$row['col_attribute'] = '';
}
$row['col_extra'] = in_array('auto_increment', $vals) ? 'auto_increment' : '';
$row['col_extra'] = in_array('auto_increment', $vals, true) ? 'auto_increment' : '';
}
}

View File

@ -169,7 +169,7 @@ class Common
$dtnI = $con['DTN'][$i];
$retval[$ti] = [];
$retval[$ti][$cNameI] = [];
if (in_array($dtnI, $tableDbNames) && in_array($con['STN'][$i], $tableDbNames)) {
if (in_array($dtnI, $tableDbNames, true) && in_array($con['STN'][$i], $tableDbNames, true)) {
$retval[$ti][$cNameI][$dtnI] = [];
$retval[$ti][$cNameI][$dtnI][$con['DCN'][$i]] = [0 => $con['STN'][$i], 1 => $con['SCN'][$i]];
}

View File

@ -269,12 +269,12 @@ class Events
}
$query .= 'ON SCHEDULE ';
if (! empty($_POST['item_type']) && in_array($_POST['item_type'], $this->type)) {
if (! empty($_POST['item_type']) && in_array($_POST['item_type'], $this->type, true)) {
if ($_POST['item_type'] === 'RECURRING') {
if (
! empty($_POST['item_interval_value'])
&& ! empty($_POST['item_interval_field'])
&& in_array($_POST['item_interval_field'], $this->interval)
&& in_array($_POST['item_interval_field'], $this->interval, true)
) {
$query .= 'EVERY ' . intval($_POST['item_interval_value']) . ' ';
$query .= $_POST['item_interval_field'] . ' ';

View File

@ -361,7 +361,10 @@ class Routines
}
$retval['item_returntype'] = '';
if (isset($_POST['item_returntype']) && in_array($_POST['item_returntype'], Util::getSupportedDatatypes())) {
if (
isset($_POST['item_returntype'])
&& in_array($_POST['item_returntype'], Util::getSupportedDatatypes(), true)
) {
$retval['item_returntype'] = $_POST['item_returntype'];
}
@ -600,7 +603,7 @@ class Routines
if (
$itemType === 'PROCEDURE'
&& ! empty($itemParamDir[$i])
&& in_array($itemParamDir[$i], $this->directions)
&& in_array($itemParamDir[$i], $this->directions, true)
) {
$params .= $itemParamDir[$i] . ' '
. Util::backquote($itemParamName[$i])
@ -639,7 +642,7 @@ class Routines
if (! empty($itemParamOpsText[$i])) {
if ($this->dbi->types->getTypeClass($itemParamType[$i]) === 'CHAR') {
if (! in_array($itemParamType[$i], ['VARBINARY', 'BINARY'])) {
if (! in_array($itemParamType[$i], ['VARBINARY', 'BINARY'], true)) {
$params .= ' CHARSET '
. mb_strtolower($itemParamOpsText[$i]);
}
@ -677,7 +680,7 @@ class Routines
$itemReturnType = $_POST['item_returntype'] ?? null;
if (! empty($itemReturnType) && in_array($itemReturnType, Util::getSupportedDatatypes())) {
if ($itemReturnType !== '' && in_array($itemReturnType, Util::getSupportedDatatypes(), true)) {
$query .= 'RETURNS ' . $itemReturnType;
} else {
$GLOBALS['errors'][] = __('You must provide a valid return type for the routine.');
@ -817,7 +820,7 @@ class Routines
}
$itemSqlDataAccess = $_POST['item_sqldataaccess'] ?? '';
if (! empty($itemSqlDataAccess) && in_array($itemSqlDataAccess, $this->sqlDataAccess)) {
if (in_array($itemSqlDataAccess, $this->sqlDataAccess, true)) {
$query .= $itemSqlDataAccess . ' ';
}
@ -858,7 +861,7 @@ class Routines
if (
! empty($_POST['funcs'][$routine['item_param_name'][$i]])
&& in_array($_POST['funcs'][$routine['item_param_name'][$i]], $allFunctions)
&& in_array($_POST['funcs'][$routine['item_param_name'][$i]], $allFunctions, true)
) {
$queries[] = sprintf(
'SET @p%d=%s(%s);',
@ -1050,6 +1053,7 @@ class Routines
|| in_array(
mb_strtolower($routine['item_param_type'][$i]),
$noSupportTypes,
true,
)
) {
$params[$i]['generator'] = null;
@ -1074,7 +1078,7 @@ class Routines
$params[$i]['class'] = 'datefield';
}
if (in_array($routine['item_param_type'][$i], ['ENUM', 'SET'])) {
if (in_array($routine['item_param_type'][$i], ['ENUM', 'SET'], true)) {
if ($routine['item_param_type'][$i] === 'ENUM') {
$params[$i]['input_type'] = 'radio';
} else {
@ -1085,7 +1089,7 @@ class Routines
$value = htmlentities(Util::unQuote($value), ENT_QUOTES);
$params[$i]['htmlentities'][] = $value;
}
} elseif (in_array(mb_strtolower($routine['item_param_type'][$i]), $noSupportTypes)) {
} elseif (in_array(mb_strtolower($routine['item_param_type'][$i]), $noSupportTypes, true)) {
$params[$i]['input_type'] = null;
} else {
$params[$i]['input_type'] = 'text';

View File

@ -3058,6 +3058,7 @@ class Results
isset($_REQUEST['pftext']) && in_array(
$_REQUEST['pftext'],
[self::DISPLAY_PARTIAL_TEXT, self::DISPLAY_FULL_TEXT],
true,
)
) {
$query['pftext'] = $_REQUEST['pftext'];
@ -3072,6 +3073,7 @@ class Results
isset($_REQUEST['relational_display']) && in_array(
$_REQUEST['relational_display'],
[self::RELATIONAL_KEY, self::RELATIONAL_DISPLAY_COLUMN],
true,
)
) {
$query['relational_display'] = $_REQUEST['relational_display'];
@ -3087,6 +3089,7 @@ class Results
isset($_REQUEST['geoOption']) && in_array(
$_REQUEST['geoOption'],
[self::GEOMETRY_DISP_WKT, self::GEOMETRY_DISP_WKB, self::GEOMETRY_DISP_GEOM],
true,
)
) {
$query['geoOption'] = $_REQUEST['geoOption'];

View File

@ -408,9 +408,9 @@ class Error extends Message
'_realConnect',
];
if (in_array($function, $includeFunctions)) {
if (in_array($function, $includeFunctions, true)) {
$retval .= self::relPath($arg);
} elseif (in_array($function, $connectFunctions) && is_string($arg)) {
} elseif (in_array($function, $connectFunctions, true) && is_string($arg)) {
$retval .= gettype($arg) . ' ********';
} elseif (is_scalar($arg)) {
$retval .= gettype($arg) . ' '

View File

@ -16,6 +16,7 @@ use function array_splice;
use function count;
use function defined;
use function error_reporting;
use function function_exists;
use function htmlspecialchars;
use function sprintf;
@ -61,7 +62,7 @@ class ErrorHandler
public function __construct()
{
if (! Util::isErrorReportingAvailable()) {
if (! function_exists('error_reporting')) {
return;
}
@ -192,7 +193,7 @@ class ErrorHandler
string $errfile,
int $errline,
): bool {
if (Util::isErrorReportingAvailable()) {
if (function_exists('error_reporting')) {
/**
* Check if Error Control Operator (@) was used, but still show
* user errors even in this case.

View File

@ -98,7 +98,7 @@ class Export
/** @var string[] $handlers */
$handlers = ob_list_handlers();
return in_array('ob_gzhandler', $handlers);
return in_array('ob_gzhandler', $handlers, true);
}
/**
@ -599,10 +599,10 @@ class Export
* Export at the database level
*
* @param DatabaseName $db the database to export
* @param mixed[] $tables the tables to export
* @param string[] $tables the tables to export
* @param string $whatStrucOrData structure or data or both
* @param mixed[] $tableStructure whether to export structure for each table
* @param mixed[] $tableData whether to export data for each table
* @param string[] $tableStructure whether to export structure for each table
* @param string[] $tableData whether to export data for each table
* @param ExportPlugin $exportPlugin the selected export plugin
* @param string $errorUrl the URL in case of error
* @param string $exportType the export type
@ -677,7 +677,7 @@ class Export
if (
($whatStrucOrData === 'structure'
|| $whatStrucOrData === 'structure_and_data')
&& in_array($table, $tableStructure)
&& in_array($table, $tableStructure, true)
) {
// for a view, export a stand-in definition of the table
// to resolve view dependencies (only when it's a single-file export)
@ -739,7 +739,7 @@ class Export
// if this is a view or a merge table, don't export data
if (
($whatStrucOrData === 'data' || $whatStrucOrData === 'structure_and_data')
&& in_array($table, $tableData)
&& in_array($table, $tableData, true)
&& ! $isView
) {
$tableObj = new Table($table, $db->getName(), $this->dbi);
@ -764,7 +764,7 @@ class Export
if (
! isset($GLOBALS['sql_create_trigger']) || ($whatStrucOrData !== 'structure'
&& $whatStrucOrData !== 'structure_and_data')
|| ! in_array($table, $tableStructure)
|| ! in_array($table, $tableStructure, true)
) {
continue;
}

View File

@ -141,7 +141,7 @@ class Footer
$params['server'] = $GLOBALS['server'];
if (isset($_REQUEST['single_table']) && in_array($_REQUEST['single_table'], [true, false])) {
if (isset($_REQUEST['single_table'])) {
$params['single_table'] = $_REQUEST['single_table'];
}

View File

@ -367,7 +367,7 @@ class Git
$dataline = array_shift($commit);
$datalinearr = explode(' ', $dataline, 2);
$linetype = $datalinearr[0];
if (! in_array($linetype, ['author', 'committer'])) {
if (! in_array($linetype, ['author', 'committer'], true)) {
continue;
}
@ -380,7 +380,7 @@ class Git
if ($linetype === 'author') {
$author = $user2;
} elseif ($linetype === 'committer') {
} else {
$committer = $user2;
}
} while ($dataline != '');

View File

@ -908,7 +908,7 @@ class Generator
// set all other attributes
$attributeString = '';
foreach ($attributes as $key => $value) {
if (in_array($key, ['alt', 'title'])) {
if (in_array($key, ['alt', 'title'], true)) {
continue;
}

View File

@ -40,7 +40,7 @@ class Index
/**
* Columns in index
*
* @var array<string, IndexColumn>
* @var array<string|int, IndexColumn>
*/
private array $columns = [];

View File

@ -451,7 +451,7 @@ class InsertEdit
}
$inputMinMax = '';
$isInteger = in_array($column->trueType, $this->dbi->types->getIntegerTypes());
$isInteger = in_array($column->trueType, $this->dbi->types->getIntegerTypes(), true);
if ($isInteger) {
$extractedColumnspec = Util::extractColumnSpec($column->type);
$isUnsigned = $extractedColumnspec['unsigned'];
@ -730,7 +730,6 @@ class InsertEdit
* @param mixed[] $extractedColumnspec associative array containing type,
* spec_in_brackets and possibly
* enum_set_values (another array)
* @param mixed[] $gisDataTypes list of GIS data types
* @param string $columnNameAppendix string to append to column name in input
* @param bool $asIs use the data as is, used in repopulating
*
@ -742,7 +741,6 @@ class InsertEdit
array $currentRow,
InsertEditColumn $column,
array $extractedColumnspec,
array $gisDataTypes,
string $columnNameAppendix,
bool $asIs,
): array {
@ -772,7 +770,7 @@ class InsertEdit
? $currentRow[$column->field]
: Util::addMicroseconds($currentRow[$column->field]);
$specialChars = htmlspecialchars($currentRow[$column->field], ENT_COMPAT);
} elseif (in_array($column->trueType, $gisDataTypes)) {
} elseif (in_array($column->trueType, Gis::getDataTypes(), true)) {
// Convert gis data to Well Know Text format
$currentRow[$column->field] = $asIs
? $currentRow[$column->field]
@ -879,7 +877,7 @@ class InsertEdit
public function getGotoInclude(string|false $gotoInclude): string
{
$validOptions = ['new_insert', 'same_insert', 'edit_next'];
if (isset($_POST['after_insert']) && in_array($_POST['after_insert'], $validOptions)) {
if (isset($_POST['after_insert']) && in_array($_POST['after_insert'], $validOptions, true)) {
return '/table/change';
}
@ -1170,8 +1168,8 @@ class InsertEdit
}
if (
in_array($editField->function, $this->getGisFromTextFunctions())
|| in_array($editField->function, $this->getGisFromWKBFunctions())
in_array($editField->function, $this->getGisFromTextFunctions(), true)
|| in_array($editField->function, $this->getGisFromWKBFunctions(), true)
) {
preg_match('/^(\'?)(.*?)\1(?:,(\d+))?$/', $editField->value, $matches);
$escapedParams = $this->dbi->quoteString($matches[2]) . (isset($matches[3]) ? ',' . $matches[3] : '');
@ -1180,8 +1178,8 @@ class InsertEdit
}
if (
! in_array($editField->function, self::FUNC_NO_PARAM)
|| ($editField->value !== '' && in_array($editField->function, self::FUNC_OPTIONAL_PARAM))
! in_array($editField->function, self::FUNC_NO_PARAM, true)
|| ($editField->value !== '' && in_array($editField->function, self::FUNC_OPTIONAL_PARAM, true))
) {
if (
($editField->salt !== null
@ -1635,9 +1633,6 @@ class InsertEdit
// in the name attribute (see bug #1746964 )
$columnNameAppendix = $vkey . '[' . $fieldHashMd5 . ']';
// Get a list of GIS data types.
$gisDataTypes = Gis::getDataTypes();
// Prepares the field value
if ($currentRow !== []) {
// (we are editing)
@ -1651,7 +1646,6 @@ class InsertEdit
$currentRow,
$column,
$extractedColumnspec,
$gisDataTypes,
$columnNameAppendix,
$asIs,
);
@ -1872,7 +1866,7 @@ class InsertEdit
'is_value_foreign_link' => $foreignData['foreign_link'] === true,
'backup_field' => $backupField,
'data' => $data,
'gis_data_types' => $gisDataTypes,
'gis_data_types' => Gis::getDataTypes(),
'foreign_dropdown' => $foreignDropdown,
'data_type' => $dataType,
'textarea_cols' => $textareaCols,
@ -1962,7 +1956,7 @@ class InsertEdit
}
$virtual = ['VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED'];
if (in_array($tableColumn->extra, $virtual)) {
if (in_array($tableColumn->extra, $virtual, true)) {
continue;
}

View File

@ -144,7 +144,7 @@ class Language
*/
public function isRTL(): bool
{
return in_array($this->code, ['ar', 'fa', 'he', 'ur']);
return in_array($this->code, ['ar', 'fa', 'he', 'ur'], true);
}
/**

View File

@ -224,7 +224,7 @@ class Menu
$tabs['structure']['icon'] = 'b_props';
$tabs['structure']['route'] = '/table/structure';
$tabs['structure']['text'] = __('Structure');
$tabs['structure']['active'] = in_array($route, ['/table/relation', '/table/structure']);
$tabs['structure']['active'] = in_array($route, ['/table/relation', '/table/structure'], true);
$tabs['sql']['icon'] = 'b_sql';
$tabs['sql']['route'] = '/table/sql';
@ -234,7 +234,11 @@ class Menu
$tabs['search']['icon'] = 'b_search';
$tabs['search']['text'] = __('Search');
$tabs['search']['route'] = '/table/search';
$tabs['search']['active'] = in_array($route, ['/table/find-replace', '/table/search', '/table/zoom-search']);
$tabs['search']['active'] = in_array($route, [
'/table/find-replace',
'/table/search',
'/table/zoom-search',
], true);
if (! $isSystemSchema && (! $tableIsView || $updatableView)) {
$tabs['insert']['icon'] = 'b_insrow';
@ -459,13 +463,13 @@ class Menu
'/server/status/processes',
'/server/status/queries',
'/server/status/variables',
]);
], true);
if ($isSuperUser || $isCreateOrGrantUser) {
$tabs['rights']['icon'] = 's_rights';
$tabs['rights']['route'] = '/server/privileges';
$tabs['rights']['text'] = __('User accounts');
$tabs['rights']['active'] = in_array($route, ['/server/privileges', '/server/user-groups']);
$tabs['rights']['active'] = in_array($route, ['/server/privileges', '/server/user-groups'], true);
}
$tabs['export']['icon'] = 'b_export';
@ -490,7 +494,7 @@ class Menu
'/preferences/navigation',
'/preferences/sql',
'/preferences/two-factor',
]);
], true);
if (! empty($binaryLogs)) {
$tabs['binlog']['icon'] = 's_tbl';

View File

@ -552,45 +552,45 @@ class NavigationTree
// Get items to hide
$hidden = $db->getHiddenItems($this->relationParameters, 'group');
$config = Config::getInstance();
if (! $config->settings['NavigationTreeShowTables'] && ! in_array('tables', $hidden)) {
if (! $config->settings['NavigationTreeShowTables'] && ! in_array('tables', $hidden, true)) {
$hidden[] = 'tables';
}
if (! $config->settings['NavigationTreeShowViews'] && ! in_array('views', $hidden)) {
if (! $config->settings['NavigationTreeShowViews'] && ! in_array('views', $hidden, true)) {
$hidden[] = 'views';
}
if (! $config->settings['NavigationTreeShowFunctions'] && ! in_array('functions', $hidden)) {
if (! $config->settings['NavigationTreeShowFunctions'] && ! in_array('functions', $hidden, true)) {
$hidden[] = 'functions';
}
if (! $config->settings['NavigationTreeShowProcedures'] && ! in_array('procedures', $hidden)) {
if (! $config->settings['NavigationTreeShowProcedures'] && ! in_array('procedures', $hidden, true)) {
$hidden[] = 'procedures';
}
if (! $config->settings['NavigationTreeShowEvents'] && ! in_array('events', $hidden)) {
if (! $config->settings['NavigationTreeShowEvents'] && ! in_array('events', $hidden, true)) {
$hidden[] = 'events';
}
$retval = [];
if (! $db->hasChildren()) {
if (! in_array('tables', $hidden) && $db->getPresence('tables')) {
if (! in_array('tables', $hidden, true) && $db->getPresence('tables')) {
$retval['tables'] = new NodeTableContainer();
}
if (! in_array('views', $hidden) && $db->getPresence('views')) {
if (! in_array('views', $hidden, true) && $db->getPresence('views')) {
$retval['views'] = new NodeViewContainer();
}
if (! in_array('functions', $hidden) && $db->getPresence('functions')) {
if (! in_array('functions', $hidden, true) && $db->getPresence('functions')) {
$retval['functions'] = new NodeFunctionContainer();
}
if (! in_array('procedures', $hidden) && $db->getPresence('procedures')) {
if (! in_array('procedures', $hidden, true) && $db->getPresence('procedures')) {
$retval['procedures'] = new NodeProcedureContainer();
}
if (! in_array('events', $hidden) && $db->getPresence('events')) {
if (! in_array('events', $hidden, true) && $db->getPresence('events')) {
$retval['events'] = new NodeEventContainer();
}
@ -1031,8 +1031,8 @@ class NavigationTree
// if node name itself is in sterile, then allow
$nodeIsGroup = $node->isGroup
|| (! in_array($parentName, $sterile) && ! $node->isNew)
|| (in_array($node->realName, $sterile) && $node->children !== []);
|| (! in_array($parentName, $sterile, true) && ! $node->isNew)
|| (in_array($node->realName, $sterile, true) && $node->children !== []);
if ($nodeIsGroup) {
$match = $this->findTreeMatch($this->vPath, $paths['vPath_clean']);
$linkClasses = $node->getCssClasses($match);

View File

@ -786,7 +786,7 @@ class Node
continue;
}
if (in_array($arr[0], $retval)) {
if (in_array($arr[0], $retval, true)) {
continue;
}
@ -844,7 +844,7 @@ class Node
continue;
}
if (in_array($arr[0], $retval)) {
if (in_array($arr[0], $retval, true)) {
continue;
}

View File

@ -276,7 +276,7 @@ class NodeDatabase extends Node
if ($relationParameters->navigationItemsHidingFeature !== null) {
$hiddenItems = $this->getHiddenItems($relationParameters, substr($type, 0, -1));
foreach ($retval as $key => $item) {
if (! in_array($item, $hiddenItems)) {
if (! in_array($item, $hiddenItems, true)) {
continue;
}

View File

@ -74,7 +74,11 @@ class Normalization
$column = $def->field;
$extractedColumnSpec = Util::extractColumnSpec($def->type);
if ($columnTypeList !== [] && ! in_array(mb_strtoupper($extractedColumnSpec['type']), $columnTypeList)) {
if (
$columnTypeList !== [] && ! in_array(mb_strtoupper(
$extractedColumnSpec['type'],
), $columnTypeList, true)
) {
continue;
}
@ -411,7 +415,7 @@ class Normalization
);
$cnt = 0;
foreach ($columns as $column) {
if (in_array($column, $pk)) {
if (in_array($column, $pk, true)) {
continue;
}
@ -691,7 +695,7 @@ class Normalization
);
$query = 'ALTER TABLE ' . Util::backquote($originalTable);
foreach ($columns as $col) {
if (in_array($col, $colPresent)) {
if (in_array($col, $colPresent, true)) {
continue;
}
@ -836,7 +840,7 @@ class Normalization
}
foreach ($columns as $column) {
if (in_array($column, $pk)) {
if (in_array($column, $pk, true)) {
continue;
}
@ -846,7 +850,7 @@ class Normalization
}
foreach ($columns as $column) {
if (in_array($column, $pk)) {
if (in_array($column, $pk, true)) {
continue;
}
@ -913,7 +917,7 @@ class Normalization
$table,
);
foreach ($columns as $column) {
if (in_array($column, $pk)) {
if (in_array($column, $pk, true)) {
continue;
}

View File

@ -78,7 +78,7 @@ class AuthenticationSignon extends AuthenticationPlugin
if (
isset($sessionCookieParams['samesite'])
&& ! in_array($sessionCookieParams['samesite'], ['Lax', 'Strict'])
&& ! in_array($sessionCookieParams['samesite'], ['Lax', 'Strict'], true)
) {
// Not a valid value for samesite
unset($sessionCookieParams['samesite']);

View File

@ -584,7 +584,7 @@ class ExportHtmlword extends ExportPlugin
$fmtPre = '';
$fmtPost = '';
if (in_array($column->field, $uniqueKeys)) {
if (in_array($column->field, $uniqueKeys, true)) {
$fmtPre = '<strong>' . $fmtPre;
$fmtPost .= '</strong>';
}

View File

@ -598,7 +598,7 @@ class ExportLatex extends ExportPlugin
$localBuffer = '\\textit{' . mb_substr($localBuffer, 0, $pos) . '}' . mb_substr($localBuffer, $pos);
}
if (in_array($fieldName, $uniqueKeys)) {
if (in_array($fieldName, $uniqueKeys, true)) {
$pos = (int) mb_strpos($localBuffer, "\000");
$localBuffer = '\\textbf{' . mb_substr($localBuffer, 0, $pos) . '}' . mb_substr($localBuffer, $pos);
}

View File

@ -540,7 +540,7 @@ class ExportTexytext extends ExportPlugin
$fmtPre = '';
$fmtPost = '';
if (in_array($column->field, $uniqueKeys)) {
if (in_array($column->field, $uniqueKeys, true)) {
$fmtPre = '**' . $fmtPre;
$fmtPost .= '**';
}

View File

@ -102,7 +102,7 @@ class DiaRelationSchema extends ExportRelationSchema
// put the foreign table on the schema only if selected by the user
// (do not use array_search() because we would have to do a === false and this is not PHP3 compatible)
if ($masterField !== 'foreign_keys_data') {
if (in_array($rel['foreign_table'], $alltables)) {
if (in_array($rel['foreign_table'], $alltables, true)) {
$this->addRelation(
$oneTable,
$masterField,
@ -116,7 +116,7 @@ class DiaRelationSchema extends ExportRelationSchema
}
foreach ($rel as $oneKey) {
if (! in_array($oneKey['ref_table_name'], $alltables)) {
if (! in_array($oneKey['ref_table_name'], $alltables, true)) {
continue;
}

View File

@ -111,7 +111,7 @@ class EpsRelationSchema extends ExportRelationSchema
* to do a === false and this is not PHP3 compatible)
*/
if ($masterField !== 'foreign_keys_data') {
if (in_array($rel['foreign_table'], $alltables)) {
if (in_array($rel['foreign_table'], $alltables, true)) {
$this->addRelation(
$oneTable,
$this->eps->getFont(),
@ -127,7 +127,7 @@ class EpsRelationSchema extends ExportRelationSchema
}
foreach ($rel as $oneKey) {
if (! in_array($oneKey['ref_table_name'], $alltables)) {
if (! in_array($oneKey['ref_table_name'], $alltables, true)) {
continue;
}

View File

@ -211,7 +211,7 @@ class PdfRelationSchema extends ExportRelationSchema
// (do not use array_search() because we would have to
// to do a === false and this is not PHP3 compatible)
if ($masterField !== 'foreign_keys_data') {
if (in_array($rel['foreign_table'], $alltables)) {
if (in_array($rel['foreign_table'], $alltables, true)) {
$this->addRelation($oneTable, $masterField, $rel['foreign_table'], $rel['foreign_field']);
}
@ -219,7 +219,7 @@ class PdfRelationSchema extends ExportRelationSchema
}
foreach ($rel as $oneKey) {
if (! in_array($oneKey['ref_table_name'], $alltables)) {
if (! in_array($oneKey['ref_table_name'], $alltables, true)) {
continue;
}

View File

@ -126,7 +126,7 @@ class SvgRelationSchema extends ExportRelationSchema
* to do a === false and this is not PHP3 compatible)
*/
if ($masterField !== 'foreign_keys_data') {
if (in_array($rel['foreign_table'], $alltables)) {
if (in_array($rel['foreign_table'], $alltables, true)) {
$this->addRelation(
$oneTable,
$this->svg->getFont(),
@ -142,7 +142,7 @@ class SvgRelationSchema extends ExportRelationSchema
}
foreach ($rel as $oneKey) {
if (! in_array($oneKey['ref_table_name'], $alltables)) {
if (! in_array($oneKey['ref_table_name'], $alltables, true)) {
continue;
}

View File

@ -18,7 +18,7 @@ class MariaDbMySqlKbsProvider implements ServerVariablesProviderInterface
}
}
/** @return mixed[] */
/** @return string[] */
public function getStaticVariables(): array
{
return [];

View File

@ -8,7 +8,7 @@ interface ServerVariablesProviderInterface
{
public function getVariableType(string $name): string|null;
/** @return mixed[] */
/** @return string[] */
public function getStaticVariables(): array;
public function getDocLinkByNameMariaDb(string $name): string|null;

View File

@ -11,7 +11,7 @@ class VoidProvider implements ServerVariablesProviderInterface
return null;
}
/** @return mixed[] */
/** @return string[] */
public function getStaticVariables(): array
{
return [];

View File

@ -185,7 +185,7 @@ class Compatibility
// except TINYINT(1).
// See: https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-19.html
$integerTypes = ['SMALLINT', 'MEDIUMINT', 'INT', 'BIGINT'];
$typeLengthNotAllowed = in_array($type, $integerTypes) || $type === 'TINYINT' && $length !== '1';
$typeLengthNotAllowed = in_array($type, $integerTypes, true) || $type === 'TINYINT' && $length !== '1';
return ! (self::isIntegersLengthRestricted($dbi) && $typeLengthNotAllowed);
}

View File

@ -290,7 +290,7 @@ class ReplicationGui
'Replicate_Wild_Do_Table',
'Replicate_Wild_Ignore_Table',
];
if (! in_array($variable, $variablesWrap)) {
if (! in_array($variable, $variablesWrap, true)) {
continue;
}

View File

@ -183,7 +183,7 @@ class Privileges
$usersGrants = explode(',', $row['Table_priv']);
foreach ($avGrants as $currentGrant) {
$row[$currentGrant . '_priv'] = in_array($currentGrant, $usersGrants) ? 'Y' : 'N';
$row[$currentGrant . '_priv'] = in_array($currentGrant, $usersGrants, true) ? 'Y' : 'N';
}
unset($row['Table_priv']);
@ -1462,7 +1462,7 @@ class Privileges
$dbRightsSqls = [];
foreach ($tablesToSearchForUsers as $tableSearchIn) {
if (! in_array($tableSearchIn, $tables)) {
if (! in_array($tableSearchIn, $tables, true)) {
continue;
}
@ -1614,6 +1614,7 @@ class Privileges
$onePrivilege['grant'] = in_array(
'Grant',
explode(',', $row['Table_priv']),
true,
);
$onePrivilege['column_privs'] = ! empty($row['Column_priv']);
$onePrivilege['privileges'] = implode(',', $this->extractPrivInfo($row, true));
@ -1625,6 +1626,7 @@ class Privileges
$onePrivilege['grant'] = in_array(
'Grant',
explode(',', $row['Proc_priv']),
true,
);
$privs = $this->parseProcPriv($row['Proc_priv']);
@ -1682,7 +1684,7 @@ class Privileges
$databases = [];
$escapedDatabases = [];
foreach ($predDbArray as $currentDb) {
if (in_array($currentDb, $databasesToSkip)) {
if (in_array($currentDb, $databasesToSkip, true)) {
continue;
}
@ -1691,7 +1693,7 @@ class Privileges
// because the list of databases has special characters
// already escaped in $foundRows,
// contrary to the output of SHOW DATABASES
if (in_array($currentDbEscaped, $foundRows)) {
if (in_array($currentDbEscaped, $foundRows, true)) {
continue;
}
@ -1707,7 +1709,7 @@ class Privileges
$tables = [];
if ($result) {
while ($row = $result->fetchRow()) {
if (in_array($row[0], $foundRows)) {
if (in_array($row[0], $foundRows, true)) {
continue;
}
@ -1721,7 +1723,7 @@ class Privileges
$routines = [];
foreach ($routineData as $routine) {
if (in_array($routine['name'], $foundRows)) {
if (in_array($routine['name'], $foundRows, true)) {
continue;
}
@ -2797,38 +2799,38 @@ class Privileges
while ($row2 = $res2->fetchAssoc()) {
$tmpArray = explode(',', $row2['Column_priv']);
if (in_array('Select', $tmpArray)) {
if (in_array('Select', $tmpArray, true)) {
$tmpPrivs2['Select'][] = $row2['Column_name'];
}
if (in_array('Insert', $tmpArray)) {
if (in_array('Insert', $tmpArray, true)) {
$tmpPrivs2['Insert'][] = $row2['Column_name'];
}
if (in_array('Update', $tmpArray)) {
if (in_array('Update', $tmpArray, true)) {
$tmpPrivs2['Update'][] = $row2['Column_name'];
}
if (! in_array('References', $tmpArray)) {
if (! in_array('References', $tmpArray, true)) {
continue;
}
$tmpPrivs2['References'][] = $row2['Column_name'];
}
if ($tmpPrivs2['Select'] !== [] && ! in_array('SELECT', $tmpPrivs1)) {
if ($tmpPrivs2['Select'] !== [] && ! in_array('SELECT', $tmpPrivs1, true)) {
$tmpPrivs1[] = 'SELECT (`' . implode('`, `', $tmpPrivs2['Select']) . '`)';
}
if ($tmpPrivs2['Insert'] !== [] && ! in_array('INSERT', $tmpPrivs1)) {
if ($tmpPrivs2['Insert'] !== [] && ! in_array('INSERT', $tmpPrivs1, true)) {
$tmpPrivs1[] = 'INSERT (`' . implode('`, `', $tmpPrivs2['Insert']) . '`)';
}
if ($tmpPrivs2['Update'] !== [] && ! in_array('UPDATE', $tmpPrivs1)) {
if ($tmpPrivs2['Update'] !== [] && ! in_array('UPDATE', $tmpPrivs1, true)) {
$tmpPrivs1[] = 'UPDATE (`' . implode('`, `', $tmpPrivs2['Update']) . '`)';
}
if ($tmpPrivs2['References'] !== [] && ! in_array('REFERENCES', $tmpPrivs1)) {
if ($tmpPrivs2['References'] !== [] && ! in_array('REFERENCES', $tmpPrivs1, true)) {
$tmpPrivs1[] = 'REFERENCES (`' . implode('`, `', $tmpPrivs2['References']) . '`)';
}
@ -2837,7 +2839,7 @@ class Privileges
. Util::backquote($row['Table_name'])
. ' TO ' . $this->dbi->quoteString($username)
. '@' . $this->dbi->quoteString($hostname)
. (in_array('Grant', explode(',', $row['Table_priv']))
. (in_array('Grant', explode(',', $row['Table_priv']), true)
? ' WITH GRANT OPTION;'
: ';');
}

View File

@ -28,9 +28,8 @@ class SysInfo
public static function getOs(string $phpOs = PHP_OS): string
{
// look for common UNIX-like systems
$unixLike = ['FreeBSD', 'DragonFly'];
if (in_array($phpOs, $unixLike)) {
$phpOs = 'Linux';
if (in_array($phpOs, ['FreeBSD', 'DragonFly'], true)) {
return 'Linux';
}
return ucfirst($phpOs);

View File

@ -180,7 +180,7 @@ final class ColumnsDefinition
} elseif (isset($fieldsMeta[$columnNumber])) {
$columnMeta = $fieldsMeta[$columnNumber];
$virtual = ['VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED'];
if (in_array($columnMeta['Extra'], $virtual)) {
if (in_array($columnMeta['Extra'], $virtual, true)) {
$tableObj = new Table($GLOBALS['table'], $GLOBALS['db'], $this->dbi);
$expressions = $tableObj->getColumnGenerationExpression($columnMeta['Field']);
$columnMeta['Expression'] = is_array($expressions) ? $expressions[$columnMeta['Field']] : null;

View File

@ -287,7 +287,7 @@ final class Search
// If the where clause is something like 'IsEmpty(`spatial_col_name`)'
if (isset($geomUnaryFunctions[$geomFunc]) && trim($criteriaValues) == '') {
$where = $geomFunctionApplied;
} elseif (in_array($type, Gis::getDataTypes()) && ! empty($criteriaValues)) {
} elseif (in_array($type, Gis::getDataTypes(), true) && ! empty($criteriaValues)) {
// create gis data from the criteria input
$gisData = Gis::createData($criteriaValues, $this->dbi->getVersion());
$where = $geomFunctionApplied . ' ' . $funcType . ' ' . $gisData;

View File

@ -443,23 +443,23 @@ class Table implements Stringable
/**
* generates column specification for ALTER or CREATE TABLE syntax
*
* @param string $name name
* @param string $type type ('INT', 'VARCHAR', 'BIT', ...)
* @param string $length length ('2', '5,2', '', ...)
* @param string $attribute attribute
* @param string $collation collation
* @param bool|string $null with 'NULL' or 'NOT NULL'
* @param string $defaultType whether default is CURRENT_TIMESTAMP,
* NULL, NONE, USER_DEFINED, UUID
* @param string $defaultValue default value for USER_DEFINED
* default type
* @param string $extra 'AUTO_INCREMENT'
* @param string $comment field comment
* @param string $virtuality virtuality of the column
* @param string $expression expression for the virtual column
* @param string $moveTo new position for column
* @param mixed[]|null $columnsWithIndex Fields having PRIMARY or UNIQUE KEY indexes
* @param string|null $oldColumnName Old column name
* @param string $name name
* @param string $type type ('INT', 'VARCHAR', 'BIT', ...)
* @param string $length length ('2', '5,2', '', ...)
* @param string $attribute attribute
* @param string $collation collation
* @param bool|string $null with 'NULL' or 'NOT NULL'
* @param string $defaultType whether default is CURRENT_TIMESTAMP,
* NULL, NONE, USER_DEFINED, UUID
* @param string $defaultValue default value for USER_DEFINED
* default type
* @param string $extra 'AUTO_INCREMENT'
* @param string $comment field comment
* @param string $virtuality virtuality of the column
* @param string $expression expression for the virtual column
* @param string $moveTo new position for column
* @param (string|int)[]|null $columnsWithIndex Fields having PRIMARY or UNIQUE KEY indexes
* @param string|null $oldColumnName Old column name
*
* @return string field specification
*
@ -751,23 +751,23 @@ class Table implements Stringable
*
* @see Table::generateFieldSpec()
*
* @param string $oldcol old column name
* @param string $newcol new column name
* @param string $type type ('INT', 'VARCHAR', 'BIT', ...)
* @param string $length length ('2', '5,2', '', ...)
* @param string $attribute attribute
* @param string $collation collation
* @param bool|string $null with 'NULL' or 'NOT NULL'
* @param string $defaultType whether default is CURRENT_TIMESTAMP,
* NULL, NONE, USER_DEFINED
* @param string $defaultValue default value for USER_DEFINED default
* type
* @param string $extra 'AUTO_INCREMENT'
* @param string $comment field comment
* @param string $virtuality virtuality of the column
* @param string $expression expression for the virtual column
* @param string $moveTo new position for column
* @param mixed[]|null $columnsWithIndex Fields having PRIMARY or UNIQUE KEY indexes
* @param string $oldcol old column name
* @param string $newcol new column name
* @param string $type type ('INT', 'VARCHAR', 'BIT', ...)
* @param string $length length ('2', '5,2', '', ...)
* @param string $attribute attribute
* @param string $collation collation
* @param bool|string $null with 'NULL' or 'NOT NULL'
* @param string $defaultType whether default is CURRENT_TIMESTAMP,
* NULL, NONE, USER_DEFINED
* @param string $defaultValue default value for USER_DEFINED default
* type
* @param string $extra 'AUTO_INCREMENT'
* @param string $comment field comment
* @param string $virtuality virtuality of the column
* @param string $expression expression for the virtual column
* @param string $moveTo new position for column
* @param (string|int)[]|null $columnsWithIndex Fields having PRIMARY or UNIQUE KEY indexes
*
* @return string field specification
*/
@ -1475,7 +1475,7 @@ class Table implements Stringable
}
// a column might have a primary and an unique index on it
if (in_array($possibleColumn, $return)) {
if (in_array($possibleColumn, $return, true)) {
continue;
}
@ -2007,7 +2007,7 @@ class Table implements Stringable
if (
$index->getChoice() !== 'SPATIAL'
&& $index->getChoice() !== 'FULLTEXT'
&& in_array($type, Index::getIndexTypes())
&& in_array($type, Index::getIndexTypes(), true)
&& ! $this->isEngine('TOKUDB')
) {
$sqlQuery .= ' USING ' . $type;
@ -2477,7 +2477,7 @@ class Table implements Stringable
*
* @param int $types types bitmask
*
* @return mixed[] an array of columns
* @return (string|int)[] an array of columns
*/
public function getColumnsWithIndex(int $types): array
{

View File

@ -88,7 +88,7 @@ class Tracking
* Filters tracking entries
*
* @param list<array{date: string, username: string, statement: string}> $data the entries to filter
* @param mixed[] $filterUsers users
* @param string[] $filterUsers users
*
* @return mixed[] filtered entries
*/
@ -101,10 +101,9 @@ class Tracking
$tmpEntries = [];
$id = 0;
foreach ($data as $entry) {
$filteredUser = in_array($entry['username'], $filterUsers);
if (
$this->isDateBetweenInclusive(new DateTimeImmutable($entry['date']), $dateFrom, $dateTo)
&& (in_array('*', $filterUsers) || $filteredUser)
&& (in_array('*', $filterUsers, true) || in_array($entry['username'], $filterUsers, true))
) {
$tmpEntries[] = [
'id' => $id,
@ -190,7 +189,7 @@ class Tracking
*
* @param TrackedData $trackedData data
* @param mixed[] $urlParams url params
* @param mixed[] $filterUsers filter users
* @param string[] $filterUsers filter users
* @psalm-param 'schema'|'data'|'schema_and_data' $logType
*/
public function getHtmlForTrackingReport(
@ -313,7 +312,7 @@ class Tracking
*
* @param TrackedData $trackedData data
* @param mixed[] $urlParams url params
* @param mixed[] $filterUsers filter users
* @param string[] $filterUsers filter users
* @param string $str1 HTML for log_type select
* @param string $str2 HTML for "from date"
* @param string $str3 HTML for "to date"
@ -458,7 +457,7 @@ class Tracking
* Function to get html for data manipulation statements
*
* @param TrackedData $trackedData data
* @param mixed[] $filterUsers filter users
* @param string[] $filterUsers filter users
* @param mixed[] $urlParams url parameters
* @param int $ddlogCount data definition log count
* @param string $dropImageOrText drop image or text
@ -493,7 +492,7 @@ class Tracking
* Function to get html for data definition statements in schema snapshot
*
* @param TrackedData $trackedData data
* @param mixed[] $filterUsers filter users
* @param string[] $filterUsers filter users
* @param mixed[] $urlParams url parameters
* @param string $dropImageOrText drop image or text
*
@ -527,7 +526,7 @@ class Tracking
* Function to get html for data statements in schema snapshot
*
* @param list<array{date: string, username: string, statement: string}> $logData tracked data
* @param mixed[] $filterUsers filter users
* @param string[] $filterUsers filter users
* @param mixed[] $urlParams url parameters
* @param string $dropImageOrText drop image or text
* @param LogTypeEnum $logType DDL|DML
@ -551,8 +550,8 @@ class Tracking
foreach ($logData as $entry) {
if (
$this->isDateBetweenInclusive(new DateTimeImmutable($entry['date']), $dateFrom, $dateTo)
&& (in_array('*', $filterUsers)
|| in_array($entry['username'], $filterUsers))
&& (in_array('*', $filterUsers, true)
|| in_array($entry['username'], $filterUsers, true))
) {
$entry['formated_statement'] = Generator::formatSql($entry['statement'], true);
$deleteParam = 'delete_' . $logType->getLogName();
@ -1071,7 +1070,7 @@ class Tracking
/**
* Function to get the entries
*
* @param mixed[] $filterUsers filter users
* @param string[] $filterUsers filter users
* @phpstan-param 'schema'|'data'|'schema_and_data' $logType
*
* @return mixed[]

View File

@ -191,20 +191,23 @@ class Triggers
$GLOBALS['errors'][] = __('You must provide a trigger name!');
}
if (! empty($_POST['item_timing']) && in_array($_POST['item_timing'], $this->time)) {
if (! empty($_POST['item_timing']) && in_array($_POST['item_timing'], $this->time, true)) {
$query .= $_POST['item_timing'] . ' ';
} else {
$GLOBALS['errors'][] = __('You must provide a valid timing for the trigger!');
}
if (! empty($_POST['item_event']) && in_array($_POST['item_event'], $this->event)) {
if (! empty($_POST['item_event']) && in_array($_POST['item_event'], $this->event, true)) {
$query .= $_POST['item_event'] . ' ';
} else {
$GLOBALS['errors'][] = __('You must provide a valid event for the trigger!');
}
$query .= 'ON ';
if (! empty($_POST['item_table']) && in_array($_POST['item_table'], $this->dbi->getTables($GLOBALS['db']))) {
if (
! empty($_POST['item_table'])
&& in_array($_POST['item_table'], $this->dbi->getTables($GLOBALS['db']), true)
) {
$query .= Util::backquote($_POST['item_table']);
} else {
$GLOBALS['errors'][] = __('You must provide a valid table name!');

View File

@ -42,7 +42,7 @@ class TwoFactor
protected TwoFactorPlugin $backend;
/** @var mixed[] */
/** @var string[] */
protected array $available;
private UserPreferences $userPreferences;
@ -101,7 +101,7 @@ class TwoFactor
return $this->backend;
}
/** @return mixed[] */
/** @return string[] */
public function getAvailable(): array
{
return $this->available;
@ -174,7 +174,7 @@ class TwoFactor
public function getBackendClass(string $name): string
{
$result = TwoFactorPlugin::class;
if (in_array($name, $this->available)) {
if (in_array($name, $this->available, true)) {
/** @psalm-var class-string<TwoFactorPlugin> $result */
$result = 'PhpMyAdmin\\Plugins\\TwoFactor\\' . ucfirst($name);
} elseif ($name !== '') {
@ -257,7 +257,7 @@ class TwoFactor
$cls = $this->getBackendClass($name);
$this->backend = new $cls($this);
} else {
if (! in_array($name, $this->available)) {
if (! in_array($name, $this->available, true)) {
return false;
}

View File

@ -47,7 +47,7 @@ class Types
*/
public function isUnaryOperator(string $op): bool
{
return in_array($op, $this->getUnaryOperators());
return in_array($op, $this->getUnaryOperators(), true);
}
/**

View File

@ -38,7 +38,6 @@ use function htmlspecialchars;
use function htmlspecialchars_decode;
use function implode;
use function in_array;
use function ini_get;
use function is_array;
use function is_numeric;
use function is_object;
@ -82,7 +81,6 @@ use function uksort;
use const ENT_COMPAT;
use const ENT_QUOTES;
use const PHP_INT_SIZE;
use const PHP_MAJOR_VERSION;
use const STR_PAD_LEFT;
/**
@ -97,7 +95,7 @@ class Util
*/
public static function showIcons(string $value): bool
{
return in_array(Config::getInstance()->settings[$value], ['icons', 'both']);
return in_array(Config::getInstance()->settings[$value], ['icons', 'both'], true);
}
/**
@ -107,7 +105,7 @@ class Util
*/
public static function showText(string $value): bool
{
return in_array(Config::getInstance()->settings[$value], ['text', 'both']);
return in_array(Config::getInstance()->settings[$value], ['text', 'both'], true);
}
/**
@ -1261,7 +1259,7 @@ class Util
* as specified in Types->getColumns() and returns an array
* (useful for quickly checking if a datatype is supported).
*
* @return mixed[] An array of datatypes.
* @return string[] An array of datatypes.
*/
public static function getSupportedDatatypes(): array
{
@ -1287,7 +1285,7 @@ class Util
* Returns a list of datatypes that are not (yet) handled by PMA.
* Used by: /table/change and libraries/Routines.php
*
* @return mixed[] list of datatypes
* @return string[] list of datatypes
*/
public static function unsupportedDatatypes(): array
{
@ -1821,7 +1819,7 @@ class Util
$whereAdded = true;
}
if (isset($_REQUEST['tbl_type']) && in_array($_REQUEST['tbl_type'], ['table', 'view'])) {
if (isset($_REQUEST['tbl_type']) && in_array($_REQUEST['tbl_type'], ['table', 'view'], true)) {
$tblGroupSql .= $whereAdded ? ' AND' : ' WHERE';
if ($_REQUEST['tbl_type'] === 'view') {
$tblGroupSql .= " `Table_type` NOT IN ('BASE TABLE', 'SYSTEM VERSIONED')";
@ -2057,7 +2055,7 @@ class Util
'sort_order' => $futureSortOrder,
];
if (isset($_REQUEST['tbl_type']) && in_array($_REQUEST['tbl_type'], ['view', 'table'])) {
if (isset($_REQUEST['tbl_type']) && in_array($_REQUEST['tbl_type'], ['view', 'table'], true)) {
$urlParams['tbl_type'] = $_REQUEST['tbl_type'];
}
@ -2100,7 +2098,7 @@ class Util
[$keyName, $value] = $keyValueArray;
$value = trim(strtolower($value));
if (strtolower(trim($keyName)) === 'proto' && in_array($value, ['http', 'https'])) {
if (strtolower(trim($keyName)) === 'proto' && in_array($value, ['http', 'https'], true)) {
return $value;
}
}
@ -2109,25 +2107,6 @@ class Util
return '';
}
/**
* Check if error reporting is available
*/
public static function isErrorReportingAvailable(): bool
{
// issue #16256 - PHP 7.x does not return false for a core function
if (PHP_MAJOR_VERSION < 8) {
$disabled = ini_get('disable_functions');
if (is_string($disabled)) {
$disabled = explode(',', $disabled);
$disabled = array_map(trim(...), $disabled);
return ! in_array('error_reporting', $disabled);
}
}
return function_exists('error_reporting');
}
public static function getTableListPosition(ServerRequest $request, string $db): int
{
if (! isset($_SESSION['tmpval']['table_limit_offset']) || $_SESSION['tmpval']['table_limit_offset_db'] != $db) {

View File

@ -50,7 +50,7 @@ abstract class AbstractTestCase extends TestCase
protected function setUp(): void
{
foreach (array_keys($GLOBALS) as $key) {
if (in_array($key, $this->globalsAllowList)) {
if (in_array($key, $this->globalsAllowList, true)) {
continue;
}
@ -189,7 +189,7 @@ abstract class AbstractTestCase extends TestCase
Config::$instance = null;
(new ReflectionProperty(Template::class, 'twig'))->setValue(null, null);
foreach (array_keys($GLOBALS) as $key) {
if (in_array($key, $this->globalsAllowList)) {
if (in_array($key, $this->globalsAllowList, true)) {
continue;
}

View File

@ -237,33 +237,29 @@ class CoreTest extends AbstractTestCase
/**
* Test for Core::checkPageValidity
*
* @param string $page Page
* @param string[] $allowList Allow list
* @param bool $include whether the page is going to be included
* @param bool $expected Expected value
* @param string $page Page
* @param bool $expected Expected value
*/
#[DataProvider('providerTestGotoNowhere')]
public function testGotoNowhere(string $page, array $allowList, bool $include, bool $expected): void
public function testGotoNowhere(string $page, bool $expected): void
{
$this->assertSame($expected, Core::checkPageValidity($page, $allowList, $include));
$this->assertSame($expected, Core::checkPageValidity($page));
}
/**
* Data provider for testGotoNowhere
*
* @return array<array{string, string[], bool, bool}>
* @return array<array{string, bool}>
*/
public static function providerTestGotoNowhere(): array
{
return [
['', [], false, false],
['', [], true, false],
['shell.php', ['index.php'], false, false],
['shell.php', ['index.php'], true, false],
['index.php?sql.php&test=true', ['index.php'], false, true],
['index.php?sql.php&test=true', ['index.php'], true, false],
['index.php%3Fsql.php%26test%3Dtrue', ['index.php'], false, true],
['index.php%3Fsql.php%26test%3Dtrue', ['index.php'], true, false],
['', false],
['shell.php', false],
['index.php?sql.php&test=true', true],
['shell.php?sql.php&test=true', false],
['index.php%3Fsql.php%26test%3Dtrue', true],
['shell.php%3Fsql.php%26test%3Dtrue', false],
];
}

View File

@ -1063,7 +1063,7 @@ class InsertEditTest extends AbstractTestCase
$this->insertEdit,
InsertEdit::class,
'getSpecialCharsAndBackupFieldForExistingRow',
[$currentRow, $column, [], [], 'a', false],
[$currentRow, $column, [], 'a', false],
);
$this->assertEquals(
@ -1094,7 +1094,7 @@ class InsertEditTest extends AbstractTestCase
$this->insertEdit,
InsertEdit::class,
'getSpecialCharsAndBackupFieldForExistingRow',
[$currentRow, $column, $extractedColumnSpec, [], 'a', false],
[$currentRow, $column, $extractedColumnSpec, 'a', false],
);
$this->assertEquals(
@ -1107,7 +1107,7 @@ class InsertEditTest extends AbstractTestCase
$this->insertEdit,
InsertEdit::class,
'getSpecialCharsAndBackupFieldForExistingRow',
[$currentRow, $column, $extractedColumnSpec, [], 'a', true],
[$currentRow, $column, $extractedColumnSpec, 'a', true],
);
$this->assertEquals(
@ -1133,7 +1133,7 @@ class InsertEditTest extends AbstractTestCase
$extractedColumnSpec['spec_in_brackets'] = '20';
$column = new InsertEditColumn(
'f',
'int',
'geometry',
false,
'PRI',
null,
@ -1149,7 +1149,7 @@ class InsertEditTest extends AbstractTestCase
$this->insertEdit,
InsertEdit::class,
'getSpecialCharsAndBackupFieldForExistingRow',
[$currentRow, $column, $extractedColumnSpec, ['int'], 'a', false],
[$currentRow, $column, $extractedColumnSpec, 'a', false],
);
$this->assertEquals(
@ -1181,7 +1181,7 @@ class InsertEditTest extends AbstractTestCase
$this->insertEdit,
InsertEdit::class,
'getSpecialCharsAndBackupFieldForExistingRow',
[$currentRow, $column, $extractedColumnSpec, ['int'], 'a', false],
[$currentRow, $column, $extractedColumnSpec, 'a', false],
);
$this->assertEquals(
@ -1202,7 +1202,7 @@ class InsertEditTest extends AbstractTestCase
$this->insertEdit,
InsertEdit::class,
'getSpecialCharsAndBackupFieldForExistingRow',
[$currentRow, $column, $extractedColumnSpec, ['int'], 'a', false],
[$currentRow, $column, $extractedColumnSpec, 'a', false],
);
$this->assertEquals(

View File

@ -255,7 +255,7 @@ class TwoFactorTest extends AbstractTestCase
$request = new ServerRequest($this->createStub(ServerRequestInterface::class));
$object = $this->getTwoFactorAndLoadConfig('user', null);
if (! in_array('application', $object->getAvailable())) {
if (! in_array('application', $object->getAvailable(), true)) {
$this->markTestSkipped('google2fa not available');
}
@ -309,7 +309,7 @@ class TwoFactorTest extends AbstractTestCase
$request = new ServerRequest($this->createStub(ServerRequestInterface::class));
$object = $this->getTwoFactorAndLoadConfig('user', null);
if (! in_array('key', $object->getAvailable())) {
if (! in_array('key', $object->getAvailable(), true)) {
$this->markTestSkipped('u2f-php-server not available');
}
@ -375,7 +375,7 @@ class TwoFactorTest extends AbstractTestCase
$request = new ServerRequest($this->createStub(ServerRequestInterface::class));
$object = $this->getTwoFactorAndLoadConfig('user', null);
if (! in_array('key', $object->getAvailable())) {
if (! in_array('key', $object->getAvailable(), true)) {
$this->markTestSkipped('u2f-php-server not available');
}