Skip to content

Commit 607071a

Browse files
Merge pull request #19591 from kamil-tekiela/Fix-type-hints
Removed some mixed type hints
2 parents 0baaf10 + b36ae99 commit 607071a

19 files changed

Lines changed: 107 additions & 455 deletions

phpstan-baseline.neon

Lines changed: 16 additions & 196 deletions
Original file line numberDiff line numberDiff line change
@@ -327,12 +327,6 @@ parameters:
327327
count: 2
328328
path: src/BrowseForeigners.php
329329

330-
-
331-
message: '#^Parameter \#1 \$description of method PhpMyAdmin\\BrowseForeigners\:\:getDescriptionAndTitle\(\) expects string, mixed given\.$#'
332-
identifier: argument.type
333-
count: 2
334-
path: src/BrowseForeigners.php
335-
336330
-
337331
message: '#^Parameter \#1 \$state of static method PhpMyAdmin\\Charsets\\Charset\:\:fromServer\(\) expects array\{Charset\?\: string, Description\?\: string, Default collation\?\: string, Maxlen\?\: string\}, array\<string\|null\> given\.$#'
338332
identifier: argument.type
@@ -402,50 +396,14 @@ parameters:
402396
count: 1
403397
path: src/Command/FixPoTwigCommand.php
404398

405-
-
406-
message: '#^Cannot access offset ''exception'' on mixed\.$#'
407-
identifier: offsetAccess.nonOffsetAccessible
408-
count: 1
409-
path: src/Command/TwigLintCommand.php
410-
411-
-
412-
message: '#^Cannot access offset ''file'' on mixed\.$#'
413-
identifier: offsetAccess.nonOffsetAccessible
414-
count: 2
415-
path: src/Command/TwigLintCommand.php
416-
417-
-
418-
message: '#^Cannot access offset ''template'' on mixed\.$#'
419-
identifier: offsetAccess.nonOffsetAccessible
420-
count: 1
421-
path: src/Command/TwigLintCommand.php
422-
423-
-
424-
message: '#^Cannot access offset ''valid'' on mixed\.$#'
425-
identifier: offsetAccess.nonOffsetAccessible
426-
count: 2
427-
path: src/Command/TwigLintCommand.php
428-
429-
-
430-
message: '#^Only booleans are allowed in &&, mixed given on the left side\.$#'
431-
identifier: booleanAnd.leftNotBoolean
432-
count: 1
433-
path: src/Command/TwigLintCommand.php
434-
435-
-
436-
message: '#^Only booleans are allowed in a negated boolean, mixed given\.$#'
437-
identifier: booleanNot.exprNotBoolean
438-
count: 1
439-
path: src/Command/TwigLintCommand.php
440-
441399
-
442400
message: '#^Only booleans are allowed in a ternary operator condition, \(callable\)\|null given\.$#'
443401
identifier: ternary.condNotBoolean
444402
count: 1
445403
path: src/Command/TwigLintCommand.php
446404

447405
-
448-
message: '#^Only booleans are allowed in a ternary operator condition, mixed given\.$#'
406+
message: '#^Only booleans are allowed in a ternary operator condition, string given\.$#'
449407
identifier: ternary.condNotBoolean
450408
count: 1
451409
path: src/Command/TwigLintCommand.php
@@ -462,30 +420,6 @@ parameters:
462420
count: 1
463421
path: src/Command/TwigLintCommand.php
464422

465-
-
466-
message: '#^Parameter \#2 \$template of method PhpMyAdmin\\Command\\TwigLintCommand\:\:renderException\(\) expects string, mixed given\.$#'
467-
identifier: argument.type
468-
count: 1
469-
path: src/Command/TwigLintCommand.php
470-
471-
-
472-
message: '#^Parameter \#2 \.\.\.\$values of function sprintf expects bool\|float\|int\|string\|null, mixed given\.$#'
473-
identifier: argument.type
474-
count: 1
475-
path: src/Command/TwigLintCommand.php
476-
477-
-
478-
message: '#^Parameter \#3 \$exception of method PhpMyAdmin\\Command\\TwigLintCommand\:\:renderException\(\) expects Twig\\Error\\Error, mixed given\.$#'
479-
identifier: argument.type
480-
count: 1
481-
path: src/Command/TwigLintCommand.php
482-
483-
-
484-
message: '#^Parameter \#4 \$file of method PhpMyAdmin\\Command\\TwigLintCommand\:\:renderException\(\) expects string\|null, mixed given\.$#'
485-
identifier: argument.type
486-
count: 1
487-
path: src/Command/TwigLintCommand.php
488-
489423
-
490424
message: '''
491425
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Dbal\\DatabaseInterface\:
@@ -1815,12 +1749,6 @@ parameters:
18151749
count: 4
18161750
path: src/ConfigStorage/UserGroups.php
18171751

1818-
-
1819-
message: '#^Call to function in_array\(\) requires parameter \#3 to be set\.$#'
1820-
identifier: function.strict
1821-
count: 1
1822-
path: src/ConfigStorage/UserGroups.php
1823-
18241752
-
18251753
message: '#^Only booleans are allowed in &&, int\|string given on the right side\.$#'
18261754
identifier: booleanAnd.rightNotBoolean
@@ -1893,12 +1821,6 @@ parameters:
18931821
count: 1
18941822
path: src/Controllers/Database/DataDictionaryController.php
18951823

1896-
-
1897-
message: '#^Cannot access offset string on mixed\.$#'
1898-
identifier: offsetAccess.nonOffsetAccessible
1899-
count: 1
1900-
path: src/Controllers/Database/DataDictionaryController.php
1901-
19021824
-
19031825
message: '#^Binary operation "\." between mixed and ''\.'' results in an error\.$#'
19041826
identifier: binaryOp.invalid
@@ -7047,12 +6969,6 @@ parameters:
70476969
count: 2
70486970
path: src/Export/Export.php
70496971

7050-
-
7051-
message: '#^Binary operation "\.\=" between mixed and non\-empty\-string results in an error\.$#'
7052-
identifier: assignOp.invalid
7053-
count: 1
7054-
path: src/Export/Export.php
7055-
70566972
-
70576973
message: '''
70586974
#^Call to deprecated method getInstance\(\) of class PhpMyAdmin\\Config\:
@@ -7341,10 +7257,16 @@ parameters:
73417257
count: 1
73427258
path: src/File.php
73437259

7260+
-
7261+
message: '#^Cannot access offset ''error'' on mixed\.$#'
7262+
identifier: offsetAccess.nonOffsetAccessible
7263+
count: 1
7264+
path: src/File.php
7265+
73447266
-
73457267
message: '#^Cannot access offset ''multi_edit'' on mixed\.$#'
73467268
identifier: offsetAccess.nonOffsetAccessible
7347-
count: 7
7269+
count: 4
73487270
path: src/File.php
73497271

73507272
-
@@ -7353,10 +7275,16 @@ parameters:
73537275
count: 1
73547276
path: src/File.php
73557277

7278+
-
7279+
message: '#^Cannot access offset ''tmp_name'' on mixed\.$#'
7280+
identifier: offsetAccess.nonOffsetAccessible
7281+
count: 1
7282+
path: src/File.php
7283+
73567284
-
73577285
message: '#^Cannot access offset string on mixed\.$#'
73587286
identifier: offsetAccess.nonOffsetAccessible
7359-
count: 13
7287+
count: 7
73607288
path: src/File.php
73617289

73627290
-
@@ -7407,12 +7335,6 @@ parameters:
74077335
count: 1
74087336
path: src/File.php
74097337

7410-
-
7411-
message: '#^Parameter \#1 \$file of method PhpMyAdmin\\File\:\:fetchUploadedFromTblChangeRequestMultiple\(\) expects array\<mixed\>, mixed given\.$#'
7412-
identifier: argument.type
7413-
count: 1
7414-
path: src/File.php
7415-
74167338
-
74177339
message: '#^Parameter \#1 \$file of method PhpMyAdmin\\ZipExtension\:\:getContents\(\) expects string, string\|null given\.$#'
74187340
identifier: argument.type
@@ -9684,12 +9606,6 @@ parameters:
96849606
count: 4
96859607
path: src/Normalization.php
96869608

9687-
-
9688-
message: '#^Binary operation "\." between "\\n" and mixed results in an error\.$#'
9689-
identifier: binaryOp.invalid
9690-
count: 1
9691-
path: src/Operations.php
9692-
96939609
-
96949610
message: '#^Binary operation "\." between '', "'' and mixed results in an error\.$#'
96959611
identifier: binaryOp.invalid
@@ -9798,12 +9714,6 @@ parameters:
97989714
count: 8
97999715
path: src/Operations.php
98009716

9801-
-
9802-
message: '#^Parameter \#1 \$query of method PhpMyAdmin\\Dbal\\DatabaseInterface\:\:query\(\) expects string, mixed given\.$#'
9803-
identifier: argument.type
9804-
count: 1
9805-
path: src/Operations.php
9806-
98079717
-
98089718
message: '#^Parameter \#1 \$query of method PhpMyAdmin\\Dbal\\DatabaseInterface\:\:query\(\) expects string, string\|null given\.$#'
98099719
identifier: argument.type
@@ -14484,12 +14394,6 @@ parameters:
1448414394
count: 1
1448514395
path: src/Server/SysInfo/WindowsNt.php
1448614396

14487-
-
14488-
message: '#^Cannot call method getMessage\(\) on mixed\.$#'
14489-
identifier: method.nonObject
14490-
count: 1
14491-
path: src/Session.php
14492-
1449314397
-
1449414398
message: '#^Construct empty\(\) is not allowed\. Use more strict comparison\.$#'
1449514399
identifier: empty.notAllowed
@@ -14502,12 +14406,6 @@ parameters:
1450214406
count: 1
1450314407
path: src/Session.php
1450414408

14505-
-
14506-
message: '#^Parameter \#1 \$string of function htmlspecialchars expects string, mixed given\.$#'
14507-
identifier: argument.type
14508-
count: 1
14509-
path: src/Session.php
14510-
1451114409
-
1451214410
message: '#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\.$#'
1451314411
identifier: foreach.nonIterable
@@ -14724,18 +14622,6 @@ parameters:
1472414622
count: 1
1472514623
path: src/Sql.php
1472614624

14727-
-
14728-
message: '#^Cannot access property \$name on mixed\.$#'
14729-
identifier: property.nonObject
14730-
count: 1
14731-
path: src/Sql.php
14732-
14733-
-
14734-
message: '#^Cannot access property \$table on mixed\.$#'
14735-
identifier: property.nonObject
14736-
count: 4
14737-
path: src/Sql.php
14738-
1473914625
-
1474014626
message: '#^Cannot call method has\(\) on PhpMyAdmin\\SqlParser\\Components\\OptionsArray\|null\.$#'
1474114627
identifier: method.nonObject
@@ -16146,12 +16032,6 @@ parameters:
1614616032
count: 1
1614716033
path: src/Util.php
1614816034

16149-
-
16150-
message: '#^Binary operation "\." between mixed and '', '' results in an error\.$#'
16151-
identifier: binaryOp.invalid
16152-
count: 1
16153-
path: src/Util.php
16154-
1615516035
-
1615616036
message: '#^Binary operation "\." between non\-empty\-string and array\<string\>\|string\|false results in an error\.$#'
1615716037
identifier: binaryOp.invalid
@@ -16182,48 +16062,6 @@ parameters:
1618216062
count: 9
1618316063
path: src/Util.php
1618416064

16185-
-
16186-
message: '#^Cannot access offset ''Cardinality'' on mixed\.$#'
16187-
identifier: offsetAccess.nonOffsetAccessible
16188-
count: 1
16189-
path: src/Util.php
16190-
16191-
-
16192-
message: '#^Cannot access offset ''Column_name'' on mixed\.$#'
16193-
identifier: offsetAccess.nonOffsetAccessible
16194-
count: 3
16195-
path: src/Util.php
16196-
16197-
-
16198-
message: '#^Cannot access offset ''Comment'' on mixed\.$#'
16199-
identifier: offsetAccess.nonOffsetAccessible
16200-
count: 1
16201-
path: src/Util.php
16202-
16203-
-
16204-
message: '#^Cannot access offset ''Key_name'' on mixed\.$#'
16205-
identifier: offsetAccess.nonOffsetAccessible
16206-
count: 1
16207-
path: src/Util.php
16208-
16209-
-
16210-
message: '#^Cannot access offset ''Non_unique'' on mixed\.$#'
16211-
identifier: offsetAccess.nonOffsetAccessible
16212-
count: 1
16213-
path: src/Util.php
16214-
16215-
-
16216-
message: '#^Cannot access offset ''Seq_in_index'' on mixed\.$#'
16217-
identifier: offsetAccess.nonOffsetAccessible
16218-
count: 3
16219-
path: src/Util.php
16220-
16221-
-
16222-
message: '#^Cannot access offset ''Sub_part'' on mixed\.$#'
16223-
identifier: offsetAccess.nonOffsetAccessible
16224-
count: 1
16225-
path: src/Util.php
16226-
1622716065
-
1622816066
message: '#^Cannot access offset ''table_limit_offset'' on mixed\.$#'
1622916067
identifier: offsetAccess.nonOffsetAccessible
@@ -16257,7 +16095,7 @@ parameters:
1625716095
-
1625816096
message: '#^Loose comparison via "\!\=" is not allowed\.$#'
1625916097
identifier: notEqual.notAllowed
16260-
count: 4
16098+
count: 3
1626116099
path: src/Util.php
1626216100

1626316101
-
@@ -16821,30 +16659,12 @@ parameters:
1682116659
count: 1
1682216660
path: src/ZipExtension.php
1682316661

16824-
-
16825-
message: '#^Parameter \#1 \$data of function gzcompress expects string, mixed given\.$#'
16826-
identifier: argument.type
16827-
count: 1
16828-
path: src/ZipExtension.php
16829-
1683016662
-
1683116663
message: '#^Parameter \#1 \$keys of function array_combine expects array\<int\|string\>, array\<mixed, mixed\> given\.$#'
1683216664
identifier: argument.type
1683316665
count: 1
1683416666
path: src/ZipExtension.php
1683516667

16836-
-
16837-
message: '#^Parameter \#1 \$string of function crc32 expects string, mixed given\.$#'
16838-
identifier: argument.type
16839-
count: 1
16840-
path: src/ZipExtension.php
16841-
16842-
-
16843-
message: '#^Parameter \#1 \$string of function strlen expects string, mixed given\.$#'
16844-
identifier: argument.type
16845-
count: 1
16846-
path: src/ZipExtension.php
16847-
1684816668
-
1684916669
message: '#^Parameter \#3 \$subject of function str_replace expects array\<string\>\|string, \(int\|string\) given\.$#'
1685016670
identifier: argument.type

0 commit comments

Comments
 (0)