-
Notifications
You must be signed in to change notification settings - Fork 659
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MethodSignatureMismatch does not infer the type from phpdoc in child class #5899
Comments
I found these snippets: https://psalm.dev/r/aecae498b8<?php
abstract class AbstractClass
{
/**
* @param int[] $oldTemplateParameters
* @param int[] $newTemplateParameters
*/
abstract protected function doUpdate(
array $oldTemplateParameters,
array $newTemplateParameters
): bool;
}
class ChildClass extends AbstractClass
{
/**
* @param int[] $oldTemplateParameters
* @param int[] $newTemplateParameters
*/
protected function doUpdate(array $oldTemplateParameters, array $newTemplateParameters): bool
{
return true;
}
}
|
Seems like Psalm ignored the phpdoc. Do you have any ParseError reported by Psalm? (If it can't read the doc, it fallbacks to the signature and |
@orklah there is no mention of ParseError in the report. Psalm 4.6.3, also repeats on 4.7.3. PHP 7.4 |
This is weird. We'd need to reproduce it somehow. Is your project public or can you make a reproducer on a github repo? |
@orklah https://github.com/Snowfall022/psalm-issue-case/tree/master I found that this issue repeats when I use phalcon stubs |
I'll take a look this afternoon. In the meantime, could you try to reduce the list of stubs until you identify which one cause the issue? |
@orklah any of them, actually. Reduced to single item. |
It even reproduce when the only stub is actually an empty file, as long as there is |
This is actually a duplicate of #5626 where @markrandall already analyzed the issue and came to the same conclusion :) |
In this snippet it properly works, but in my project I have this scan result:
What could be the reason and how to force psalm to use my phpdoc?
The text was updated successfully, but these errors were encountered: