Skip to content

Commit db5341a

Browse files
Merge pull request #18381 from kamil-tekiela/Psalm-5.10
Update Psalm baseline
2 parents 1921a8b + 82427ce commit db5341a

4 files changed

Lines changed: 68 additions & 82 deletions

File tree

‎libraries/classes/ConfigStorage/Relation.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ public function foreignDropdown(
977977
* @return array<string, mixed> data about the foreign keys
978978
* @psalm-return array{
979979
* foreign_link: bool,
980-
* the_total: mixed,
980+
* the_total: int|string|null,
981981
* foreign_display: string,
982982
* disp_row: list<non-empty-array>|null,
983983
* foreign_field: mixed

‎phpstan-baseline.neon‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ parameters:
666666
path: libraries/classes/ConfigStorage/Relation.php
667667

668668
-
669-
message: "#^Method PhpMyAdmin\\\\ConfigStorage\\\\Relation\\:\\:getForeignData\\(\\) should return array\\{foreign_link\\: bool, the_total\\: mixed, foreign_display\\: string, disp_row\\: array\\<int, non\\-empty\\-array\\>\\|null, foreign_field\\: mixed\\} but returns array\\{foreign_link\\: bool, the_total\\: int\\|string\\|null, foreign_display\\: string, disp_row\\: array\\<int, array\\<string\\|null\\>\\>\\|null, foreign_field\\: mixed\\}\\.$#"
669+
message: "#^Method PhpMyAdmin\\\\ConfigStorage\\\\Relation\\:\\:getForeignData\\(\\) should return array\\{foreign_link\\: bool, the_total\\: int\\|string\\|null, foreign_display\\: string, disp_row\\: array\\<int, non\\-empty\\-array\\>\\|null, foreign_field\\: mixed\\} but returns array\\{foreign_link\\: bool, the_total\\: int\\|string\\|null, foreign_display\\: string, disp_row\\: array\\<int, array\\<string\\|null\\>\\>\\|null, foreign_field\\: mixed\\}\\.$#"
670670
count: 1
671671
path: libraries/classes/ConfigStorage/Relation.php
672672

@@ -9360,11 +9360,6 @@ parameters:
93609360
count: 1
93619361
path: test/classes/Gis/GisPolygonTest.php
93629362

9363-
-
9364-
message: "#^Method PhpMyAdmin\\\\Tests\\\\Gis\\\\GisPolygonTest\\:\\:providerForTestGetPointOnSurface\\(\\) should return array\\<array\\{array\\}\\> but returns array\\{array\\{mixed\\}, array\\{mixed\\}\\}\\.$#"
9365-
count: 1
9366-
path: test/classes/Gis/GisPolygonTest.php
9367-
93689363
-
93699364
message: "#^Casting to string something that's already string\\.$#"
93709365
count: 1

‎psalm-baseline.xml‎

Lines changed: 65 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="5.9.0@8b9ad1eb9e8b7d3101f949291da2b9f7767cd163">
2+
<files psalm-version="5.10.0@a5effd2d2dddd1a7ea7a0f6a051ce63ff979e356">
33
<file src="libraries/classes/Advisory/Advisor.php">
44
<MixedArgument>
55
<code>$matches[1]</code>
@@ -26,15 +26,6 @@
2626
<MixedOperand>
2727
<code><![CDATA[$rule['justification_formula']]]></code>
2828
</MixedOperand>
29-
<UnusedClosureParam>
30-
<code>$arguments</code>
31-
<code>$arguments</code>
32-
<code>$arguments</code>
33-
<code>$arguments</code>
34-
<code>$arguments</code>
35-
<code>$arguments</code>
36-
<code>$arguments</code>
37-
</UnusedClosureParam>
3829
</file>
3930
<file src="libraries/classes/Bookmark.php">
4031
<DeprecatedMethod>
@@ -319,6 +310,9 @@
319310
<RiskyCast>
320311
<code><![CDATA[$server['port']]]></code>
321312
</RiskyCast>
313+
<TypeDoesNotContainType>
314+
<code>md5($verboseToLower) === $serverToLower</code>
315+
</TypeDoesNotContainType>
322316
</file>
323317
<file src="libraries/classes/Config/ConfigFile.php">
324318
<MixedArgument>
@@ -712,24 +706,19 @@
712706
</InvalidArgument>
713707
<InvalidReturnStatement>
714708
<code>$tableNameReplacements</code>
709+
</InvalidReturnStatement>
710+
<InvalidReturnType>
711+
<code><![CDATA[array<string, string>]]></code>
712+
</InvalidReturnType>
713+
<LessSpecificReturnStatement>
715714
<code><![CDATA[[
716715
'foreign_link' => $foreignLink,
717716
'the_total' => $theTotal,
718717
'foreign_display' => is_string($foreignDisplay) ? $foreignDisplay : '',
719718
'disp_row' => $dispRow,
720719
'foreign_field' => $foreignField,
721720
]]]></code>
722-
</InvalidReturnStatement>
723-
<InvalidReturnType>
724-
<code><![CDATA[array<string, string>]]></code>
725-
<code><![CDATA[array{
726-
* foreign_link: bool,
727-
* the_total: mixed,
728-
* foreign_display: string,
729-
* disp_row: list<non-empty-array>|null,
730-
* foreign_field: mixed
731-
* }]]></code>
732-
</InvalidReturnType>
721+
</LessSpecificReturnStatement>
733722
<MixedArgument>
734723
<code><![CDATA[$_SESSION['sql_history']]]></code>
735724
<code><![CDATA[$_SESSION['sql_history']]]></code>
@@ -814,6 +803,15 @@
814803
<code>$foreigners[$column]</code>
815804
<code><![CDATA[$row['display_field']]]></code>
816805
</MixedReturnStatement>
806+
<MoreSpecificReturnType>
807+
<code><![CDATA[array{
808+
* foreign_link: bool,
809+
* the_total: int|string|null,
810+
* foreign_display: string,
811+
* disp_row: list<non-empty-array>|null,
812+
* foreign_field: mixed
813+
* }]]></code>
814+
</MoreSpecificReturnType>
817815
<PossiblyFalseArgument>
818816
<code><![CDATA[$GLOBALS['cfg']['Server']['column_info']]]></code>
819817
<code><![CDATA[$GLOBALS['cfg']['Server']['column_info']]]></code>
@@ -4616,9 +4614,6 @@
46164614
<code>escapeString</code>
46174615
<code>escapeString</code>
46184616
</DeprecatedMethod>
4619-
<LessSpecificReturnStatement>
4620-
<code>[$fieldCount, $fieldPrimary, $fieldIndex, $fieldUnique, $fieldFullText, $fieldSpatial]</code>
4621-
</LessSpecificReturnStatement>
46224617
<MixedArgument>
46234618
<code><![CDATA[$_POST['field_name'][$column['col_index']]]]></code>
46244619
<code>$fieldPrimary[0]</code>
@@ -4676,9 +4671,10 @@
46764671
<code><![CDATA[$partition['value']]]></code>
46774672
<code><![CDATA[$partition['value_type']]]></code>
46784673
</MixedOperand>
4679-
<MoreSpecificReturnType>
4674+
<MixedReturnTypeCoercion>
4675+
<code>[$fieldCount, $fieldPrimary, $fieldIndex, $fieldUnique, $fieldFullText, $fieldSpatial]</code>
46804676
<code>array{int, array, array, array, array, array}</code>
4681-
</MoreSpecificReturnType>
4677+
</MixedReturnTypeCoercion>
46824678
<PossiblyInvalidArgument>
46834679
<code><![CDATA[$_POST['after_field']]]></code>
46844680
<code><![CDATA[$_POST['comment']]]></code>
@@ -6104,16 +6100,12 @@
61046100
<code><![CDATA[list<array<array-key, string|null>>]]></code>
61056101
<code><![CDATA[list<string|null>]]></code>
61066102
</InvalidReturnType>
6107-
<LessSpecificReturnStatement>
6108-
<code><![CDATA[array_column($this->result->fetch_all(), 0)]]></code>
6109-
</LessSpecificReturnStatement>
61106103
<MixedReturnTypeCoercion>
61116104
<code><![CDATA[array<array-key, string|null>]]></code>
6105+
<code><![CDATA[array_column($this->result->fetch_all(), 0)]]></code>
61126106
<code><![CDATA[array_column($this->result->fetch_all(), 1, 0)]]></code>
6113-
</MixedReturnTypeCoercion>
6114-
<MoreSpecificReturnType>
61156107
<code><![CDATA[list<string|null>]]></code>
6116-
</MoreSpecificReturnType>
6108+
</MixedReturnTypeCoercion>
61176109
</file>
61186110
<file src="libraries/classes/Display/Results.php">
61196111
<DeprecatedMethod>
@@ -6442,7 +6434,6 @@
64426434
<code>$afterCount</code>
64436435
<code>$posNext</code>
64446436
<code>$preCount</code>
6445-
<code>$sortedColumnMessage</code>
64466437
<code>$total</code>
64476438
</UnusedParam>
64486439
</file>
@@ -8806,14 +8797,6 @@
88068797
<code>$subpartitionCount</code>
88078798
<code>$subpartitions</code>
88088799
</MixedArgument>
8809-
<MixedArrayAccess>
8810-
<code>$subpartitions[$j]</code>
8811-
</MixedArrayAccess>
8812-
<MixedArrayAssignment>
8813-
<code>$subpartitions[$j]</code>
8814-
<code>$subpartitions[$j]</code>
8815-
<code><![CDATA[$subpartitions[$j]['prefix']]]></code>
8816-
</MixedArrayAssignment>
88178800
<MixedAssignment>
88188801
<code>$partitionCount</code>
88198802
<code><![CDATA[$partition['subpartition_count']]]></code>
@@ -9368,6 +9351,11 @@
93689351
<code><![CDATA[$GLOBALS['what']]]></code>
93699352
<code><![CDATA[$GLOBALS['what']]]></code>
93709353
</MixedOperand>
9354+
<PossiblyFalseOperand>
9355+
<code><![CDATA[date('Y-m-d', strtotime($row[$j]))]]></code>
9356+
<code><![CDATA[date('Y-m-d\TH:i:s', strtotime($row[$j]))]]></code>
9357+
<code><![CDATA[date('\P\TH\Hi\Ms\S', strtotime($row[$j]))]]></code>
9358+
</PossiblyFalseOperand>
93719359
<PossiblyInvalidArgument>
93729360
<code><![CDATA[$GLOBALS[$GLOBALS['what'] . '_null']]]></code>
93739361
</PossiblyInvalidArgument>
@@ -9542,9 +9530,6 @@
95429530
<code><![CDATA[$GLOBALS['sql_views_as_tables']]]></code>
95439531
<code><![CDATA[$GLOBALS['table_data']]]></code>
95449532
</InvalidArrayOffset>
9545-
<InvalidPropertyAssignmentValue>
9546-
<code><![CDATA[$field->key->columns]]></code>
9547-
</InvalidPropertyAssignmentValue>
95489533
<MixedArgument>
95499534
<code><![CDATA[$GLOBALS['sql_auto_increments']]]></code>
95509535
<code><![CDATA[$GLOBALS['sql_auto_increments']]]></code>
@@ -9635,6 +9620,7 @@
96359620
<code><![CDATA[$trigger['drop']]]></code>
96369621
</MixedOperand>
96379622
<MixedPropertyTypeCoercion>
9623+
<code><![CDATA[$field->key->columns]]></code>
96389624
<code><![CDATA[$field->references->columns]]></code>
96399625
</MixedPropertyTypeCoercion>
96409626
<PossiblyInvalidArrayOffset>
@@ -10460,13 +10446,18 @@
1046010446
</MixedPropertyFetch>
1046110447
<PossiblyNullArgument>
1046210448
<code>$cellAttrs</code>
10449+
<code>$sheets</code>
10450+
<code>$text</code>
1046310451
</PossiblyNullArgument>
1046410452
<PossiblyNullArrayAccess>
1046510453
<code><![CDATA[$attr['number-columns-repeated']]]></code>
1046610454
<code><![CDATA[$attr['number-columns-repeated']]]></code>
1046710455
<code><![CDATA[$tblAttr['name']]]></code>
1046810456
<code><![CDATA[$tblAttr['name']]]></code>
1046910457
</PossiblyNullArrayAccess>
10458+
<PossiblyNullReference>
10459+
<code>count</code>
10460+
</PossiblyNullReference>
1047010461
<PossiblyUnusedReturnValue>
1047110462
<code>string[]</code>
1047210463
</PossiblyUnusedReturnValue>
@@ -10622,9 +10613,6 @@
1062210613
<PossiblyInvalidCast>
1062310614
<code>$tables[$i][Import::TBL_NAME]</code>
1062410615
</PossiblyInvalidCast>
10625-
<PossiblyNullArgument>
10626-
<code><![CDATA[$namespaces['pma'] ?? null]]></code>
10627-
</PossiblyNullArgument>
1062810616
<PossiblyNullArrayAccess>
1062910617
<code><![CDATA[$attrs['name']]]></code>
1063010618
<code><![CDATA[$dbAttr['charset']]]></code>
@@ -10637,12 +10625,14 @@
1063710625
<code><![CDATA[$tblAttr['name']]]></code>
1063810626
<code><![CDATA[$tblAttr['name']]]></code>
1063910627
</PossiblyNullArrayAccess>
10628+
<PossiblyNullReference>
10629+
<code>attributes</code>
10630+
<code>children</code>
10631+
<code>count</code>
10632+
</PossiblyNullReference>
1064010633
<PossiblyUnusedReturnValue>
1064110634
<code>string[]</code>
1064210635
</PossiblyUnusedReturnValue>
10643-
<UnnecessaryVarAnnotation>
10644-
<code>SimpleXMLElement</code>
10645-
</UnnecessaryVarAnnotation>
1064610636
<UnusedVariable>
1064710637
<code>$val3</code>
1064810638
</UnusedVariable>
@@ -11836,9 +11826,6 @@
1183611826
</UnsupportedReferenceUsage>
1183711827
</file>
1183811828
<file src="libraries/classes/Replication/Replication.php">
11839-
<LessSpecificReturnStatement>
11840-
<code>$output</code>
11841-
</LessSpecificReturnStatement>
1184211829
<MixedArgument>
1184311830
<code><![CDATA[$pos['File']]]></code>
1184411831
</MixedArgument>
@@ -11853,9 +11840,10 @@
1185311840
<MixedOperand>
1185411841
<code><![CDATA[$pos['Position']]]></code>
1185511842
</MixedOperand>
11856-
<MoreSpecificReturnType>
11843+
<MixedReturnTypeCoercion>
11844+
<code>$output</code>
1185711845
<code><![CDATA[array{'File'?: string, 'Position'?: string}]]></code>
11858-
</MoreSpecificReturnType>
11846+
</MixedReturnTypeCoercion>
1185911847
<PossiblyNullArgument>
1186011848
<code>$host</code>
1186111849
</PossiblyNullArgument>
@@ -11935,9 +11923,6 @@
1193511923
<MixedAssignment>
1193611924
<code>$value</code>
1193711925
</MixedAssignment>
11938-
<PossiblyUnusedMethod>
11939-
<code>response</code>
11940-
</PossiblyUnusedMethod>
1194111926
<RedundantCast>
1194211927
<code><![CDATA[(string) $GLOBALS['db']]]></code>
1194311928
<code><![CDATA[(string) $GLOBALS['table']]]></code>
@@ -13312,12 +13297,12 @@
1331213297
<code><![CDATA[$data['name']]]></code>
1331313298
<code><![CDATA[$data['version']]]></code>
1331413299
</MixedArgument>
13300+
<MixedPropertyTypeCoercion>
13301+
<code><![CDATA[$data['colorModes']]]></code>
13302+
</MixedPropertyTypeCoercion>
1331513303
<PossiblyUnusedProperty>
1331613304
<code>$filesizeInfo</code>
1331713305
</PossiblyUnusedProperty>
13318-
<PropertyTypeCoercion>
13319-
<code><![CDATA[$data['colorModes']]]></code>
13320-
</PropertyTypeCoercion>
1332113306
<UnevaluatedCode>
1332213307
<code>return false;</code>
1332313308
</UnevaluatedCode>
@@ -13854,20 +13839,24 @@
1385413839
<file src="libraries/classes/WebAuthn/CustomServer.php">
1385513840
<InvalidReturnStatement>
1385613841
<code>$decoded</code>
13842+
</InvalidReturnStatement>
13843+
<InvalidReturnType>
13844+
<code>array{fmt: string, attStmt: mixed[], authData: string}</code>
13845+
</InvalidReturnType>
13846+
<LessSpecificReturnStatement>
1385713847
<code><![CDATA[[
1385813848
'type' => $clientData['type'],
1385913849
'challenge' => $clientData['challenge'],
1386013850
'origin' => $clientData['origin'],
1386113851
]]]></code>
13862-
</InvalidReturnStatement>
13863-
<InvalidReturnType>
13852+
</LessSpecificReturnStatement>
13853+
<MoreSpecificReturnType>
1386413854
<code><![CDATA[array{
1386513855
* type: 'webauthn.create'|'webauthn.get',
1386613856
* challenge: non-empty-string,
1386713857
* origin: non-empty-string
1386813858
* }]]></code>
13869-
<code>array{fmt: string, attStmt: mixed[], authData: string}</code>
13870-
</InvalidReturnType>
13859+
</MoreSpecificReturnType>
1387113860
</file>
1387213861
<file src="libraries/classes/ZipExtension.php">
1387313862
<MixedArgument>
@@ -13908,9 +13897,6 @@
1390813897
<code>$service</code>
1390913898
<code>$serviceName</code>
1391013899
</MixedAssignment>
13911-
<UnevaluatedCode>
13912-
<code>declare(strict_types=1);</code>
13913-
</UnevaluatedCode>
1391413900
</file>
1391513901
<file src="test/classes/AbstractNetworkTestCase.php">
1391613902
<MixedAssignment>
@@ -14626,18 +14612,15 @@
1462614612
</MixedAssignment>
1462714613
</file>
1462814614
<file src="test/classes/Gis/GisPolygonTest.php">
14629-
<LessSpecificReturnStatement>
14630-
<code><![CDATA[[[$temp['POLYGON'][0]], [$temp['POLYGON'][1]]]]]></code>
14631-
</LessSpecificReturnStatement>
1463214615
<MixedArrayAccess>
1463314616
<code><![CDATA[$temp1[0]['POLYGON'][1][3]]]></code>
1463414617
<code><![CDATA[$temp1[0]['POLYGON'][1][3]['y']]]></code>
1463514618
<code><![CDATA[$temp['POLYGON'][0]['no_of_points']]]></code>
1463614619
<code><![CDATA[$temp['POLYGON'][1]['no_of_points']]]></code>
1463714620
</MixedArrayAccess>
14638-
<MoreSpecificReturnType>
14639-
<code><![CDATA[array<array{mixed[]}>]]></code>
14640-
</MoreSpecificReturnType>
14621+
<PossiblyInvalidArgument>
14622+
<code>testGetPointOnSurface</code>
14623+
</PossiblyInvalidArgument>
1464114624
</file>
1464214625
<file src="test/classes/Gis/GisVisualizationTest.php">
1464314626
<MixedAssignment>
@@ -15494,6 +15477,14 @@
1549415477
<code>mixed[]</code>
1549515478
</MixedInferredReturnType>
1549615479
</file>
15480+
<file src="test/selenium/Database/EventsTest.php">
15481+
<PossiblyFalseOperand>
15482+
<code>$end</code>
15483+
<code>$start</code>
15484+
<code><![CDATA[date('Y-m-d', strtotime('+1 day'))]]></code>
15485+
<code><![CDATA[date('Y-m-d', strtotime('-1 day'))]]></code>
15486+
</PossiblyFalseOperand>
15487+
</file>
1549715488
<file src="test/selenium/Database/ProceduresTest.php">
1549815489
<MixedInferredReturnType>
1549915490
<code>string</code>

‎test/classes/Gis/GisPolygonTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public function testGetPointOnSurface(array $ring): void
220220
/**
221221
* data provider for testGetPointOnSurface
222222
*
223-
* @return array<array{mixed[]}>
223+
* @return list{list{mixed}, list{mixed}}
224224
*/
225225
public static function providerForTestGetPointOnSurface(): array
226226
{

0 commit comments

Comments
 (0)