Skip to content

Commit

Permalink
Update phpstan and psalm baseline
Browse files Browse the repository at this point in the history
Signed-off-by: William Desportes <williamdes@wdes.fr>
  • Loading branch information
williamdes committed Mar 5, 2022
1 parent 20a955b commit 71efab6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 34 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@
"php-webdriver/webdriver": "^1.11",
"phpmyadmin/coding-standard": "^2.1.1",
"phpstan/extension-installer": "^1.1",
"phpstan/phpstan": "^1.4.5",
"phpstan/phpstan": "^1.4.8",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^7.5 || ^8.0 || ^9.0",
"pragmarx/google2fa-qrcode": "^1.0.1",
"symfony/console": "^4.4",
"symfony/finder": "^4.4",
"symfony/twig-bridge": "^4.4",
"tecnickcom/tcpdf": "^6.4.4",
"vimeo/psalm": "^4.19"
"vimeo/psalm": "^4.22"
},
"extra": {
"branch-alias": {
Expand Down
6 changes: 3 additions & 3 deletions libraries/classes/InsertEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2999,9 +2999,9 @@ public function getTableColumns($db, $table)
/**
* Function to determine Insert/Edit rows
*
* @param string $where_clause where clause
* @param string $db current database
* @param string $table current table
* @param string|null $where_clause where clause
* @param string $db current database
* @param string $table current table
*
* @return array
*/
Expand Down
35 changes: 10 additions & 25 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,11 @@ parameters:
count: 1
path: libraries/classes/Controllers/Table/ZoomSearchController.php

-
message: "#^Variable \\$mime_type on left side of \\?\\? always exists and is not nullable\\.$#"
count: 2
path: libraries/classes/Controllers/TransformationWrapperController.php

-
message: "#^Property PhpMyAdmin\\\\SqlParser\\\\Statements\\\\CreateStatement\\:\\:\\$body \\(array\\<PhpMyAdmin\\\\SqlParser\\\\Token\\>\\|string\\) in isset\\(\\) is not nullable\\.$#"
count: 1
Expand Down Expand Up @@ -1595,11 +1600,6 @@ parameters:
count: 3
path: libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php

-
message: "#^Parameter \\#2 \\$masterField of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Dia\\\\DiaRelationSchema\\:\\:addRelation\\(\\) expects string, int\\|string given\\.$#"
count: 1
path: libraries/classes/Plugins/Schema/Dia/DiaRelationSchema.php

-
message: "#^Parameter \\#2 \\$master_table of class PhpMyAdmin\\\\Plugins\\\\Schema\\\\Dia\\\\RelationStatsDia constructor expects PhpMyAdmin\\\\Plugins\\\\Schema\\\\Dia\\\\TableStatsDia, PhpMyAdmin\\\\Plugins\\\\Schema\\\\Dia\\\\TableStatsDia\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\TableStatsEps\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\TableStatsPdf\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\TableStatsSvg given\\.$#"
count: 1
Expand Down Expand Up @@ -1705,11 +1705,6 @@ parameters:
count: 1
path: libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php

-
message: "#^Parameter \\#4 \\$masterField of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\EpsRelationSchema\\:\\:addRelation\\(\\) expects string, int\\|string given\\.$#"
count: 1
path: libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php

-
message: "#^Parameter \\#5 \\$fontSize of class PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\TableStatsEps constructor expects int, float\\|int\\|string given\\.$#"
count: 1
Expand Down Expand Up @@ -1905,11 +1900,6 @@ parameters:
count: 1
path: libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php

-
message: "#^Parameter \\#2 \\$masterField of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\PdfRelationSchema\\:\\:addRelation\\(\\) expects string, int\\|string given\\.$#"
count: 1
path: libraries/classes/Plugins/Schema/Pdf/PdfRelationSchema.php

-
message: "#^Parameter \\#2 \\$master_table of class PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\RelationStatsPdf constructor expects string, PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\TableStatsPdf given\\.$#"
count: 1
Expand Down Expand Up @@ -2010,6 +2000,11 @@ parameters:
count: 1
path: libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php

-
message: "#^Binary operation \"\\+\" between int\\|string\\|false and 1\\.5 results in an error\\.$#"
count: 1
path: libraries/classes/Plugins/Schema/RelationStats.php

-
message: "#^Parameter \\#1 \\$table of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\RelationStats\\:\\:getXy\\(\\) expects PhpMyAdmin\\\\Plugins\\\\Schema\\\\TableStats, string given\\.$#"
count: 2
Expand Down Expand Up @@ -2095,11 +2090,6 @@ parameters:
count: 1
path: libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php

-
message: "#^Parameter \\#4 \\$masterField of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\SvgRelationSchema\\:\\:addRelation\\(\\) expects string, int\\|string given\\.$#"
count: 1
path: libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php

-
message: "#^Parameter \\#5 \\$fontSize of class PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\TableStatsSvg constructor expects int, float\\|int\\|string given\\.$#"
count: 1
Expand Down Expand Up @@ -2695,11 +2685,6 @@ parameters:
count: 1
path: test/classes/ImportTest.php

-
message: "#^Parameter \\#1 \\$where_clause of method PhpMyAdmin\\\\InsertEdit\\:\\:determineInsertOrEdit\\(\\) expects string, null given\\.$#"
count: 1
path: test/classes/InsertEditTest.php

-
message: "#^Parameter \\#11 \\$key of method PhpMyAdmin\\\\InsertEdit\\:\\:getQueryValuesForInsertAndUpdateInMultipleEdit\\(\\) expects string, int given\\.$#"
count: 1
Expand Down
15 changes: 11 additions & 4 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="4.21.0@d8bec4c7aaee111a532daec32fb09de5687053d1">
<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703">
<file src="libraries/classes/Bookmark.php">
<RedundantCastGivenDocblockType occurrences="1">
<code>(int) $this-&gt;id</code>
Expand Down Expand Up @@ -458,9 +458,6 @@
</TypeDoesNotContainType>
</file>
<file src="libraries/classes/Controllers/Table/ChangeController.php">
<PossiblyNullArgument occurrences="1">
<code>$where_clause ?? null</code>
</PossiblyNullArgument>
<TypeDoesNotContainType occurrences="1">
<code>$biggest_max_file_size &gt; 0</code>
</TypeDoesNotContainType>
Expand Down Expand Up @@ -1655,6 +1652,16 @@
<InvalidArgument occurrences="1">
<code>[]</code>
</InvalidArgument>
<PossiblyInvalidArgument occurrences="1">
<code>$extracted</code>
</PossiblyInvalidArgument>
<PossiblyInvalidArrayAssignment occurrences="2">
<code>$analyses[$table_no][Import::FORMATTEDSQL]</code>
<code>$analyses[$table_no][Import::TYPES]</code>
</PossiblyInvalidArrayAssignment>
<PossiblyUndefinedMethod occurrences="1">
<code>getShape</code>
</PossiblyUndefinedMethod>
</file>
<file src="libraries/classes/Plugins/Import/ImportSql.php">
<InvalidArgument occurrences="2"/>
Expand Down

0 comments on commit 71efab6

Please sign in to comment.