1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-02 09:37:59 +01:00

Fix #339 - when a class is also in the callmap, use the user-defined behaviour

This commit is contained in:
Matt Brown 2018-02-22 13:42:34 -05:00
parent 39cdd00094
commit 95642aafb4
2 changed files with 14 additions and 1 deletions

View File

@ -113,7 +113,9 @@ class Methods
$old_method_id = $fq_class_name . '::' . $old_constructor_name; $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; return true;
} }

View File

@ -263,6 +263,17 @@ class MethodSignatureTest extends TestCase
} }
}', }',
], ],
'clashWithCallMapClass' => [
'<?php
class Event {}
class AClass
{
public function get(): Event
{
return new Event;
}
}',
],
]; ];
} }