-
Notifications
You must be signed in to change notification settings - Fork 650
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
Cannot override variable type with phpdoc #2807
Comments
I found these snippets: https://psalm.dev/r/0f31b34d81<?php
interface BaseInterface
{
public function getBase(): string;
}
interface SomeInterface extends BaseInterface
{
public function getSome(): ?string;
}
function send(BaseInterface $notification): bool
{
/** @var SomeInterface $notification */
echo $notification->getSome();
return true;
}
|
Sort-of dupe of #1916 |
I don't think it's related. https://psalm.dev/r/6d0482f6c1 with |
I found these snippets: https://psalm.dev/r/6d0482f6c1<?php
interface BaseInterface
{
public function getBase(): string;
}
interface SomeInterface extends BaseInterface
{
public function getSome(): ?string;
}
function send(BaseInterface $notification): bool
{
/** @var SomeInterface $notification */
if (null !== $notification->getSome()) {
return false;
}
return true;
}
|
Yes, more statements where |
Now I get it. Thank you. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://psalm.dev/r/0f31b34d81
Expected: no issues
Actual: UndefinedInterfaceMethod - 16:23 - Method BaseInterface::getsome does not exist
The text was updated successfully, but these errors were encountered: