Skip to content

Commit 67cd9b4

Browse files
Merge pull request #18828 from kamil-tekiela/parameter-names
Fix parameter names
2 parents 6a40f5a + 77e344b commit 67cd9b4

5 files changed

Lines changed: 14 additions & 25 deletions

File tree

phpstan-baseline.neon

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14466,22 +14466,22 @@ parameters:
1446614466
path: src/Plugins/Export/Helpers/Pdf.php
1446714467

1446814468
-
14469-
message: "#^Parameter \\#1 \\$orientation of method TCPDF\\:\\:AddPage\\(\\) expects string, mixed given\\.$#"
14469+
message: "#^Parameter \\#1 \\$margin \\(float\\) of method PhpMyAdmin\\\\Plugins\\\\Export\\\\Helpers\\\\Pdf\\:\\:setTopMargin\\(\\) should be contravariant with parameter \\$margin \\(float\\|int\\) of method TCPDF\\:\\:setTopMargin\\(\\)$#"
1447014470
count: 1
1447114471
path: src/Plugins/Export/Helpers/Pdf.php
1447214472

1447314473
-
14474-
message: "#^Parameter \\#1 \\$s of method TCPDF\\:\\:GetStringWidth\\(\\) expects string, mixed given\\.$#"
14474+
message: "#^Parameter \\#1 \\$orientation of method TCPDF\\:\\:AddPage\\(\\) expects string, mixed given\\.$#"
1447514475
count: 1
1447614476
path: src/Plugins/Export/Helpers/Pdf.php
1447714477

1447814478
-
14479-
message: "#^Parameter \\#1 \\$str of static method TCPDF_STATIC\\:\\:empty_string\\(\\) expects string, mixed given\\.$#"
14479+
message: "#^Parameter \\#1 \\$s of method TCPDF\\:\\:GetStringWidth\\(\\) expects string, mixed given\\.$#"
1448014480
count: 1
1448114481
path: src/Plugins/Export/Helpers/Pdf.php
1448214482

1448314483
-
14484-
message: "#^Parameter \\#1 \\$topMargin \\(float\\) of method PhpMyAdmin\\\\Plugins\\\\Export\\\\Helpers\\\\Pdf\\:\\:setTopMargin\\(\\) should be contravariant with parameter \\$margin \\(float\\|int\\) of method TCPDF\\:\\:setTopMargin\\(\\)$#"
14484+
message: "#^Parameter \\#1 \\$str of static method TCPDF_STATIC\\:\\:empty_string\\(\\) expects string, mixed given\\.$#"
1448514485
count: 1
1448614486
path: src/Plugins/Export/Helpers/Pdf.php
1448714487

psalm-baseline.xml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5819,9 +5819,6 @@
58195819
</MixedOperand>
58205820
</file>
58215821
<file src="src/Engines/Pbxt.php">
5822-
<ParamNameMismatch>
5823-
<code>$formattedSize</code>
5824-
</ParamNameMismatch>
58255822
<PossiblyUnusedMethod>
58265823
<code>getPageDocumentation</code>
58275824
</PossiblyUnusedMethod>
@@ -7922,9 +7919,6 @@
79227919
<code><![CDATA[$this->footerset[$this->page]]]></code>
79237920
<code><![CDATA[$this->footerset[$this->page]]]></code>
79247921
</MixedArrayOffset>
7925-
<ParamNameMismatch>
7926-
<code>$errorMessage</code>
7927-
</ParamNameMismatch>
79287922
<PropertyNotSetInConstructor>
79297923
<code>Pdf</code>
79307924
<code>Pdf</code>
@@ -9123,9 +9117,6 @@
91239117
<code>$y</code>
91249118
<code>count($colFits) * $sColWidth</code>
91259119
</MixedOperand>
9126-
<ParamNameMismatch>
9127-
<code>$topMargin</code>
9128-
</ParamNameMismatch>
91299120
<PossiblyNullOperand>
91309121
<code><![CDATA[$GLOBALS['maxY']]]></code>
91319122
</PossiblyNullOperand>

src/Engines/Pbxt.php

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,17 +141,15 @@ public function getVariables(): array
141141
* returns the pbxt engine specific handling for
142142
* DETAILS_TYPE_SIZE variables.
143143
*
144-
* @param int|string $formattedSize the size expression (for example 8MB)
144+
* @param int|string $value the size expression (for example 8MB)
145145
*
146146
* @return string[] the formatted value and its unit
147147
* @psalm-return array{string, string}
148148
*/
149-
public function resolveTypeSize(int|string $formattedSize): array
149+
public function resolveTypeSize(int|string $value): array
150150
{
151-
if (is_string($formattedSize) && preg_match('/^[0-9]+[a-zA-Z]+$/', $formattedSize)) {
152-
$value = Util::extractValueFromFormattedSize($formattedSize);
153-
} else {
154-
$value = $formattedSize;
151+
if (is_string($value) && preg_match('/^[0-9]+[a-zA-Z]+$/', $value)) {
152+
$value = Util::extractValueFromFormattedSize($value);
155153
}
156154

157155
return Util::formatByteDown($value);

src/Pdf.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ public function _putpages(): void
129129
/**
130130
* Displays an error message
131131
*
132-
* @param string $errorMessage the error message
132+
* @param string $msg the error message
133133
*/
134134
// phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
135-
public function Error(mixed $errorMessage = ''): never
135+
public function Error(mixed $msg = ''): never
136136
{
137137
echo Message::error(
138-
__('Error while creating PDF:') . ' ' . $errorMessage,
138+
__('Error while creating PDF:') . ' ' . $msg,
139139
)->getDisplay();
140140
ResponseRenderer::getInstance()->callExit();
141141
}

src/Plugins/Export/Helpers/Pdf.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ public function morepagestable(int|float $lineheight = 8): void
296296
* Defines the top margin.
297297
* The method can be called before creating the first page.
298298
*
299-
* @param float $topMargin the margin
299+
* @param float $margin the margin
300300
*/
301-
public function setTopMargin(mixed $topMargin): void
301+
public function setTopMargin(mixed $margin): void
302302
{
303-
$this->tMargin = $topMargin;
303+
$this->tMargin = $margin;
304304
}
305305

306306
/**

0 commit comments

Comments
 (0)