Add missing native parameter type declarations

Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
Maurício Meneghini Fauth 2023-04-01 17:51:29 -03:00
parent e8087061c6
commit 646ba27794
No known key found for this signature in database
GPG Key ID: 6A16FD38AFC89CC8
5 changed files with 6 additions and 9 deletions

View File

@ -33,7 +33,7 @@ $authMap = ['https://launchpad.net/~username' => ['user' => 'root', 'password' =
*
* @param string $contents Content to include in page
*/
function Show_page($contents): void
function Show_page(string $contents): void
{
header('Content-Type: text/html; charset=utf-8');
@ -62,7 +62,7 @@ function Show_page($contents): void
*
* @param Exception $e Exception object
*/
function Die_error($e): void
function Die_error(Throwable $e): void
{
$contents = "<div class='relyingparty_results'>\n";
$contents .= '<pre>' . htmlspecialchars($e->getMessage()) . "</pre>\n";

View File

@ -20,7 +20,7 @@ declare(strict_types=1);
*
* @return array<int,string>
*/
function get_login_credentials($user): array
function get_login_credentials(string $user): array
{
/* Optionally we can use passed username */
if (! empty($user)) {

View File

@ -130,7 +130,7 @@ class Pdf extends TCPDF
* @param string $errorMessage the error message
*/
// phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps
public function Error($errorMessage = ''): void
public function Error(mixed $errorMessage = ''): void
{
echo Message::error(
__('Error while creating PDF:') . ' ' . $errorMessage,

View File

@ -103,7 +103,7 @@ class Pdf extends PdfLib
* @param bool $addpage if true add a page, otherwise only return
* the true/false state
*/
public function checkPageBreak($h = 0, $y = '', $addpage = true): bool
public function checkPageBreak(mixed $h = 0, mixed $y = '', mixed $addpage = true): bool
{
if (TCPDF_STATIC::empty_string($y)) {
$y = $this->y;
@ -296,7 +296,7 @@ class Pdf extends PdfLib
*
* @param float $topMargin the margin
*/
public function setTopMargin($topMargin): void
public function setTopMargin(mixed $topMargin): void
{
$this->tMargin = $topMargin;
}

View File

@ -42,9 +42,6 @@
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators">
<severity>4</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint">
<severity>4</severity>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingTraversableTypeHintSpecification">
<severity>4</severity>
</rule>