From 5e3aaac940f34eb76b30c9b07b0475ea62132280 Mon Sep 17 00:00:00 2001 From: William Desportes Date: Tue, 20 Jul 2021 21:45:47 +0200 Subject: [PATCH] Upgrade tcpdf A lot of phpdoc typehints where added upstream, since it is only documentation I decided to not fix the code on QA. Signed-off-by: William Desportes --- composer.json | 2 +- phpstan-baseline.neon | 48 +++++++++++++++++++++++++++++++++++++++---- psalm-baseline.xml | 47 ++++++++++++++++++++++++++++++------------ 3 files changed, 79 insertions(+), 18 deletions(-) diff --git a/composer.json b/composer.json index 92896f6f93..f9fd00e4cb 100644 --- a/composer.json +++ b/composer.json @@ -92,7 +92,7 @@ "symfony/console": "^4.4", "symfony/finder": "^4.4", "symfony/twig-bridge": "^4.4", - "tecnickcom/tcpdf": "^6.4.1", + "tecnickcom/tcpdf": "^6.4.2", "vimeo/psalm": "^4.8.0" }, "extra": { diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 77c36bae62..e20858d38d 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1065,6 +1065,16 @@ parameters: count: 1 path: libraries/classes/OutputBuffering.php + - + message: "#^Parameter \\#1 \\$font of method TCPDF\\:\\:setFooterFont\\(\\) expects array\\, array\\ given\\.$#" + count: 1 + path: libraries/classes/Pdf.php + + - + message: "#^Parameter \\#7 \\$pdfa of method TCPDF\\:\\:__construct\\(\\) expects int, bool given\\.$#" + count: 1 + path: libraries/classes/Pdf.php + - message: "#^Method PhpMyAdmin\\\\Plugins\\:\\:getHtmlForProperty\\(\\) should return string but returns string\\|null\\.$#" count: 1 @@ -1155,6 +1165,16 @@ parameters: count: 1 path: libraries/classes/Plugins/Export/ExportXml.php + - + message: "#^Binary operation \"\\+\" between array\\\\|float and 6 results in an error\\.$#" + count: 2 + path: libraries/classes/Plugins/Export/Helpers/Pdf.php + + - + message: "#^Parameter \\#7 \\$fill of method TCPDF\\:\\:Cell\\(\\) expects bool, int given\\.$#" + count: 1 + path: libraries/classes/Plugins/Export/Helpers/Pdf.php + - message: "#^Argument of an invalid type array\\\\|false supplied for foreach, only iterables are supported\\.$#" count: 1 @@ -1406,7 +1426,7 @@ parameters: path: libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php - - message: "#^Parameter \\#3 \\$fontSize of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\EpsRelationSchema\\:\\:addRelation\\(\\) expects int, current\\|int\\|string given\\.$#" + message: "#^Parameter \\#3 \\$fontSize of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\EpsRelationSchema\\:\\:addRelation\\(\\) expects int, float\\|int\\|string given\\.$#" count: 2 path: libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php @@ -1421,7 +1441,7 @@ parameters: path: libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php - - message: "#^Parameter \\#5 \\$fontSize of class PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\TableStatsEps constructor expects int, current\\|int\\|string given\\.$#" + message: "#^Parameter \\#5 \\$fontSize of class PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\TableStatsEps constructor expects int, float\\|int\\|string given\\.$#" count: 1 path: libraries/classes/Plugins/Schema/Eps/EpsRelationSchema.php @@ -1445,6 +1465,11 @@ parameters: count: 1 path: libraries/classes/Plugins/Schema/Eps/TableStatsEps.php + - + message: "#^Parameter \\#7 \\$fill of method TCPDF\\:\\:Cell\\(\\) expects bool, int given\\.$#" + count: 1 + path: libraries/classes/Plugins/Schema/Pdf/Pdf.php + - message: "#^Cannot access property \\$customLinks on PhpMyAdmin\\\\Plugins\\\\Schema\\\\Dia\\\\Dia\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\Eps\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\Pdf\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\Svg\\|null\\.$#" count: 15 @@ -1645,6 +1670,11 @@ parameters: count: 6 path: libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php + - + message: "#^Binary operation \"\\+\\=\" between int and array\\\\|float results in an error\\.$#" + count: 1 + path: libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php + - message: "#^Call to an undefined method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Dia\\\\Dia\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Eps\\\\Eps\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\Pdf\\|PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\Svg\\:\\:GetStringWidth\\(\\)\\.$#" count: 3 @@ -1690,6 +1720,11 @@ parameters: count: 1 path: libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php + - + message: "#^Property PhpMyAdmin\\\\Plugins\\\\Schema\\\\TableStats\\:\\:\\$width \\(int\\) does not accept array\\\\|float\\|int\\.$#" + count: 1 + path: libraries/classes/Plugins/Schema/Pdf/TableStatsPdf.php + - message: "#^Parameter \\#1 \\$table of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\RelationStats\\:\\:getXy\\(\\) expects PhpMyAdmin\\\\Plugins\\\\Schema\\\\TableStats, string given\\.$#" count: 2 @@ -1766,7 +1801,7 @@ parameters: path: libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php - - message: "#^Parameter \\#3 \\$fontSize of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\SvgRelationSchema\\:\\:addRelation\\(\\) expects int, current\\|int\\|string given\\.$#" + message: "#^Parameter \\#3 \\$fontSize of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\SvgRelationSchema\\:\\:addRelation\\(\\) expects int, float\\|int\\|string given\\.$#" count: 2 path: libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php @@ -1781,7 +1816,7 @@ parameters: path: libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php - - message: "#^Parameter \\#5 \\$fontSize of class PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\TableStatsSvg constructor expects int, current\\|int\\|string given\\.$#" + message: "#^Parameter \\#5 \\$fontSize of class PhpMyAdmin\\\\Plugins\\\\Schema\\\\Svg\\\\TableStatsSvg constructor expects int, float\\|int\\|string given\\.$#" count: 1 path: libraries/classes/Plugins/Schema/Svg/SvgRelationSchema.php @@ -2265,6 +2300,11 @@ parameters: count: 1 path: test/classes/Navigation/Nodes/NodeColumnTest.php + - + message: "#^Parameter \\#1 \\$auto of method TCPDF\\:\\:SetAutoPageBreak\\(\\) expects bool, string given\\.$#" + count: 1 + path: test/classes/PdfTest.php + - message: "#^Parameter \\#1 \\$subgroupHeader of method PhpMyAdmin\\\\Properties\\\\Options\\\\Groups\\\\OptionsPropertySubgroup\\:\\:setSubgroupHeader\\(\\) expects PhpMyAdmin\\\\Properties\\\\PropertyItem, string given\\.$#" count: 1 diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 7ed8af15d3..af4ea94885 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1355,6 +1355,10 @@ + + $pdfa + [self::PMA_PDF_FONT, '', 14] + $error_message @@ -1563,9 +1567,20 @@ + + 1 + $topMargin + + $stringWidth + $totAlreadyFitted + $totalTitleWidth + $val + 6 + 6 + $comments $data @@ -1787,17 +1802,12 @@ tableDraw - - $this->diagram->getFontSize() - $this->diagram->getFontSize() - $this->diagram->getFontSize() - $diagram - + $this->x $this->x $this->x + 5 @@ -1806,6 +1816,8 @@ $this->y + 12 + $this->currentCell $this->y + 14 $this->y + 14 + $this->currentCell + 1 + 1 rect @@ -1819,18 +1831,31 @@ (int) $fontSize + + + $fill + + $this->tables[$foreignTable] $this->tables[$masterTable] - + $this->offline '' '' '' 'B' 'B' + 'auto' + 'auto' + 'auto' + 0 + 0 + 0 + 0 + 0 null @@ -1841,10 +1866,11 @@ $this->diagram - + $this->diagram $this->diagram $this->diagram + $this->diagram->customLinks['RT']['-'] $this->offline $this->orientation $this->pageNumber @@ -2225,11 +2251,6 @@ tableDraw - - $this->diagram->getFontSize() - $this->diagram->getFontSize() - $this->diagram->getFontSize() -