mirror of
https://github.com/danog/psalm.git
synced 2024-11-30 04:39:00 +01:00
Fix #339 - when a class is also in the callmap, use the user-defined behaviour
This commit is contained in:
parent
39cdd00094
commit
95642aafb4
@ -113,7 +113,9 @@ class Methods
|
||||
$old_method_id = $fq_class_name . '::' . $old_constructor_name;
|
||||
}
|
||||
|
||||
if (CallMap::inCallMap($method_id) || ($old_method_id && CallMap::inCallMap($method_id))) {
|
||||
if (!$class_storage->user_defined
|
||||
&& (CallMap::inCallMap($method_id) || ($old_method_id && CallMap::inCallMap($method_id)))
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -263,6 +263,17 @@ class MethodSignatureTest extends TestCase
|
||||
}
|
||||
}',
|
||||
],
|
||||
'clashWithCallMapClass' => [
|
||||
'<?php
|
||||
class Event {}
|
||||
class AClass
|
||||
{
|
||||
public function get(): Event
|
||||
{
|
||||
return new Event;
|
||||
}
|
||||
}',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user