We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
/** * @psalm-inheritors FooClass|BarClass */ class BaseClass {} class FooClass extends BaseClass { public function thing(string $s) : void { return $s . "hello"; } } class BarClass extends BaseClass { public function thing(int $i) : string { return $i . "hello"; } } class BazClass extends BaseClass {} // this is an error function f1(BaseClass $c) : string { switch (get_class($c)) { case FooClass:class: return $c->thing("me"); case BarClass:class: return $c->thing(5); } } function f2(BaseClass $c) : string { // this is an error as not all paths are met switch (get_class($c)) { case FooClass:class: return $c->thing("me"); } }
The text was updated successfully, but these errors were encountered:
Merge pull request #9687 from robchett/limit_inheritance
d4c5f85
WIP - Limit inheritance to a subset of classes #1450
Would be nice if there was a wildcard for the namespace, e.g. FooClass of any namespace can extend it
Sorry, something went wrong.
This would be a pain to implement for a very niche usage I think.
I'll close this btw, it has been implemented
No branches or pull requests
The text was updated successfully, but these errors were encountered: