1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-21 21:31:13 +01:00

Fix parameter offset for error

This commit is contained in:
Matthew Brown 2019-05-13 16:01:41 -04:00
parent fe0f352132
commit f33745ad25
2 changed files with 3 additions and 2 deletions

View File

@ -946,7 +946,7 @@ class ClassLikes
) {
if (IssueBuffer::accepts(
new PossiblyUnusedParam(
'Param #' . $offset . ' is never referenced in this method',
'Param #' . ($offset + 1) . ' is never referenced in this method',
$code_location
),
$method_storage->suppressed_issues

View File

@ -419,7 +419,8 @@ class UnusedCodeTest extends TestCase
}
(new A)->foo(4);',
'error_message' => 'PossiblyUnusedParam',
'error_message' => 'PossiblyUnusedParam - src' . DIRECTORY_SEPARATOR
. 'somefile.php:4:49 - Param #1 is never referenced in this method',
],
'unusedParam' => [
'<?php