Skip to content

Commit 646ba27

Browse files
committed
Add missing native parameter type declarations
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent e808706 commit 646ba27

5 files changed

Lines changed: 6 additions & 9 deletions

File tree

examples/openid.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*
3434
* @param string $contents Content to include in page
3535
*/
36-
function Show_page($contents): void
36+
function Show_page(string $contents): void
3737
{
3838
header('Content-Type: text/html; charset=utf-8');
3939

@@ -62,7 +62,7 @@ function Show_page($contents): void
6262
*
6363
* @param Exception $e Exception object
6464
*/
65-
function Die_error($e): void
65+
function Die_error(Throwable $e): void
6666
{
6767
$contents = "<div class='relyingparty_results'>\n";
6868
$contents .= '<pre>' . htmlspecialchars($e->getMessage()) . "</pre>\n";

examples/signon-script.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @return array<int,string>
2222
*/
23-
function get_login_credentials($user): array
23+
function get_login_credentials(string $user): array
2424
{
2525
/* Optionally we can use passed username */
2626
if (! empty($user)) {

libraries/classes/Pdf.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public function _putpages(): void
130130
* @param string $errorMessage the error message
131131
*/
132132
// phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
133-
public function Error($errorMessage = ''): void
133+
public function Error(mixed $errorMessage = ''): void
134134
{
135135
echo Message::error(
136136
__('Error while creating PDF:') . ' ' . $errorMessage,

libraries/classes/Plugins/Export/Helpers/Pdf.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function __construct(
103103
* @param bool $addpage if true add a page, otherwise only return
104104
* the true/false state
105105
*/
106-
public function checkPageBreak($h = 0, $y = '', $addpage = true): bool
106+
public function checkPageBreak(mixed $h = 0, mixed $y = '', mixed $addpage = true): bool
107107
{
108108
if (TCPDF_STATIC::empty_string($y)) {
109109
$y = $this->y;
@@ -296,7 +296,7 @@ public function morepagestable(int $lineheight = 8): void
296296
*
297297
* @param float $topMargin the margin
298298
*/
299-
public function setTopMargin($topMargin): void
299+
public function setTopMargin(mixed $topMargin): void
300300
{
301301
$this->tMargin = $topMargin;
302302
}

phpcs.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@
4242
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators">
4343
<severity>4</severity>
4444
</rule>
45-
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint">
46-
<severity>4</severity>
47-
</rule>
4845
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification">
4946
<severity>4</severity>
5047
</rule>

0 commit comments

Comments
 (0)