1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Merge pull request #8883 from weirdan/unused-messages-duplicates

Fixes https://github.com/vimeo/psalm/issues/8874
This commit is contained in:
Bruce Weirdan 2022-12-11 06:08:10 -04:00 committed by GitHub
commit ca0b2a1b65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 4 deletions

View File

@ -2144,7 +2144,8 @@ class ClassLikes
'Cannot find ' . ($has_variable_calls ? 'explicit' : 'any')
. ' references to property ' . $property_id
. ($has_variable_calls ? ' (but did find some potential references)' : ''),
$property_storage->location
$property_storage->location,
$property_id
);
if ($codebase->alter_code) {
@ -2173,7 +2174,8 @@ class ClassLikes
'Cannot find ' . ($has_variable_calls ? 'explicit' : 'any')
. ' references to private property ' . $property_id
. ($has_variable_calls ? ' (but did find some potential references)' : ''),
$property_storage->location
$property_storage->location,
$property_id
);
if ($codebase->alter_code) {

View File

@ -2,8 +2,21 @@
namespace Psalm\Issue;
use Psalm\CodeLocation;
use function strtolower;
final class PossiblyUnusedMethod extends MethodIssue
{
public const ERROR_LEVEL = -2;
public const SHORTCODE = 87;
public function __construct(
string $message,
CodeLocation $code_location,
string $method_id
) {
parent::__construct($message, $code_location, $method_id);
$this->dupe_key = strtolower($method_id);
}
}

View File

@ -2,8 +2,19 @@
namespace Psalm\Issue;
final class PossiblyUnusedProperty extends CodeIssue
use Psalm\CodeLocation;
final class PossiblyUnusedProperty extends PropertyIssue
{
public const ERROR_LEVEL = -2;
public const SHORTCODE = 149;
public function __construct(
string $message,
CodeLocation $code_location,
string $property_id
) {
parent::__construct($message, $code_location, $property_id);
$this->dupe_key = $property_id;
}
}

View File

@ -2,8 +2,21 @@
namespace Psalm\Issue;
use Psalm\CodeLocation;
use function strtolower;
final class UnusedMethod extends MethodIssue
{
public const ERROR_LEVEL = -2;
public const SHORTCODE = 76;
public function __construct(
string $message,
CodeLocation $code_location,
string $method_id
) {
parent::__construct($message, $code_location, $method_id);
$this->dupe_key = strtolower($method_id);
}
}

View File

@ -2,8 +2,19 @@
namespace Psalm\Issue;
final class UnusedProperty extends CodeIssue
use Psalm\CodeLocation;
final class UnusedProperty extends PropertyIssue
{
public const ERROR_LEVEL = -2;
public const SHORTCODE = 150;
public function __construct(
string $message,
CodeLocation $code_location,
string $property_id
) {
parent::__construct($message, $code_location, $property_id);
$this->dupe_key = $property_id;
}
}