mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #1125 - check protected method overridden ids for use
This commit is contained in:
parent
fa9a04369b
commit
341cb0c82c
@ -778,7 +778,7 @@ class ClassLikes
|
||||
|
||||
$method_id = $classlike_storage->name . '::' . $method_storage->cased_name;
|
||||
|
||||
if ($method_storage->visibility === ClassLikeAnalyzer::VISIBILITY_PUBLIC) {
|
||||
if ($method_storage->visibility !== ClassLikeAnalyzer::VISIBILITY_PRIVATE) {
|
||||
$method_name_lc = strtolower($method_name);
|
||||
|
||||
$has_parent_references = false;
|
||||
|
@ -322,6 +322,25 @@ class UnusedCodeTest extends TestCase
|
||||
|
||||
new A();',
|
||||
],
|
||||
'abstractMethodImplementerCoveredByParentCall' => [
|
||||
'<?php
|
||||
abstract class Foobar {
|
||||
public function doIt(): void {
|
||||
$this->inner();
|
||||
}
|
||||
|
||||
abstract protected function inner(): void;
|
||||
}
|
||||
|
||||
class MyFooBar extends Foobar {
|
||||
protected function inner(): void {
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
|
||||
$myFooBar = new MyFooBar();
|
||||
$myFooBar->doIt();',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user