Skip to content

Commit 129d35c

Browse files
committed
Fix possible invalid argument in PdfRelationSchema
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent ef485d5 commit 129d35c

3 files changed

Lines changed: 2 additions & 11 deletions

File tree

phpstan-baseline.neon

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15750,11 +15750,6 @@ parameters:
1575015750
count: 1
1575115751
path: src/Plugins/Schema/Pdf/PdfRelationSchema.php
1575215752

15753-
-
15754-
message: "#^Parameter \\#2 \\$value of method PhpMyAdmin\\\\Pdf\\:\\:setAlias\\(\\) expects string, int given\\.$#"
15755-
count: 2
15756-
path: src/Plugins/Schema/Pdf/PdfRelationSchema.php
15757-
1575815753
-
1575915754
message: "#^Parameter \\#3 \\$foreignTable of method PhpMyAdmin\\\\Plugins\\\\Schema\\\\Pdf\\\\PdfRelationSchema\\:\\:addRelation\\(\\) expects string, mixed given\\.$#"
1576015755
count: 2

psalm-baseline.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10131,10 +10131,6 @@
1013110131
<DeprecatedMethod>
1013210132
<code>DatabaseInterface::getInstance()</code>
1013310133
</DeprecatedMethod>
10134-
<InvalidArgument>
10135-
<code><![CDATA[$this->pdf->PageNo()]]></code>
10136-
<code><![CDATA[$this->pdf->PageNo()]]></code>
10137-
</InvalidArgument>
1013810134
<MixedArgument>
1013910135
<code><![CDATA[$mimeMap[$fieldName]['mimetype']]]></code>
1014010136
<code>$oneField</code>

src/Plugins/Schema/Pdf/PdfRelationSchema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function __construct(Relation $relation, DatabaseName $db)
144144
if ($this->withDoc) {
145145
$this->pdf->setLink($this->pdf->customLinks['RT']['-'], -1);
146146
$this->pdf->Bookmark(__('Relational schema'));
147-
$this->pdf->setAlias('{00}', $this->pdf->PageNo());
147+
$this->pdf->setAlias('{00}', (string) $this->pdf->PageNo());
148148
$this->topMargin = 28;
149149
$this->bottomMargin = 28;
150150
}
@@ -522,7 +522,7 @@ public function dataDictionaryDoc(array $alltables): void
522522
$this->pdf->Bookmark($table);
523523
$this->pdf->setAlias(
524524
'{' . sprintf('%02d', $z) . '}',
525-
$this->pdf->PageNo(),
525+
(string) $this->pdf->PageNo(),
526526
);
527527
$this->pdf->customLinks['RT'][$table]['-'] = $this->pdf->AddLink();
528528
$this->pdf->setLink($this->pdf->customLinks['doc'][$table]['-'], -1);

0 commit comments

Comments
 (0)