mirror of
https://github.com/danog/psalm.git
synced 2024-11-27 04:45:20 +01:00
Merge pull request #9740 from edsrzf/better-property-error
Fix OverriddenPropertyAccess error message
This commit is contained in:
commit
7483f4d809
@ -702,7 +702,7 @@ class ClassAnalyzer extends ClassLikeAnalyzer
|
||||
new OverriddenPropertyAccess(
|
||||
'Property ' . $fq_class_name . '::$' . $property_name
|
||||
. ' has different access level than '
|
||||
. $storage->name . '::$' . $property_name,
|
||||
. $guide_class_name . '::$' . $property_name,
|
||||
$property_storage->location,
|
||||
),
|
||||
);
|
||||
|
@ -5,6 +5,8 @@ namespace Psalm\Tests;
|
||||
use Psalm\Tests\Traits\InvalidCodeAnalysisTestTrait;
|
||||
use Psalm\Tests\Traits\ValidCodeAnalysisTestTrait;
|
||||
|
||||
use const DIRECTORY_SEPARATOR;
|
||||
|
||||
class ClassTest extends TestCase
|
||||
{
|
||||
use InvalidCodeAnalysisTestTrait;
|
||||
@ -936,7 +938,7 @@ class ClassTest extends TestCase
|
||||
/** @var string|null */
|
||||
private $foo;
|
||||
}',
|
||||
'error_message' => 'OverriddenPropertyAccess',
|
||||
'error_message' => 'OverriddenPropertyAccess - src' . DIRECTORY_SEPARATOR . 'somefile.php:9:33 - Property B::$foo has different access level than A::$foo',
|
||||
],
|
||||
'overridePublicPropertyAccessLevelToProtected' => [
|
||||
'code' => '<?php
|
||||
|
Loading…
Reference in New Issue
Block a user