Project

General

Profile

Actions

Bug #100850

closed

phpstan max nightly fails with phpstan 1.10.15

Added by Anja Leichsenring over 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Category:
Tests
Target version:
-
Start date:
2023-05-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The error turned up is:
------ -----------------------------------------------------------------
228 Line core/Classes/Authentication/AuthenticationService.php
229 ------ -----------------------------------------------------------------
230 227 Parameter #2 $values of function vsprintf expects
231 array<bool|float|int|string|null>, array<int|string, array<int,
232 mixed>> given.
233 ------ -----------------------------------------------------------------

The function in question is
/* * @param string $message Message to output * @param array<int,mixed> $params
*/
protected function writeLogMessage(string $message, ...$params): void

there are 3 usages, all of them pass $this->writeLogMessage(string, string), what makes the second parameter into array<int, string>

When I change the docblock accordingly, I end up with
------ -----------------------------------------------------------------------------------------------------------------------------------
Line core/Classes/Authentication/AuthenticationService.php
------ -----------------------------------------------------------------------------------------------------------------------------------
227 Parameter #2 $values of function vsprintf expects array<bool|float|int|string|null>, array<int|string, array<int, string>> given.
------ -----------------------------------------------------------------------------------------------------------------------------------

which is not correct, no nested arrays anywhere around.

I decided to include the error into the baseline file to suppress the test failure. Any feedback here is very much welcome, in case my analysis is incorrect I'd like to improve.

Actions

Also available in: Atom PDF