Closed madflow closed 1 month ago
So as far as I can see, this is due to the fact, that phpstan does not yield a line numer for baseline errors.
------ --------------------------------------------------------------
Line Controller/SomeController.php
------ --------------------------------------------------------------
5 Method SomeController::index() has no return type specified.
------ --------------------------------------------------------------
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Line Kernel.php
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Ignored error pattern #^Method App\\Kernel\:\:knall\(\) has no return type specified\.$# in path /private/tmp/actor/src/Kernel.php was not matched in reported errors.
Ignored error pattern #^Method App\\Kernel\:\:knall\(\) has parameter \$options with no value type specified in iterable type array\.$# in path /private/tmp/actor/src/Kernel.php
was not matched in reported errors.
------ -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[ERROR] Found 3 errors
Would it be feasible to set the line number to "0", if there is none?
When I hackfix this like this with stackoverflowed Lua:
for _, message in ipairs(file.messages or {}) do
local line = 0
if type(message.line) == "number" then
line = message.line - 1
end
table.insert(diagnostics, {
lnum = line,
col = 0,
message = message.message,
source = bin,
})
end
I get a better result:
you will get: