-
Notifications
You must be signed in to change notification settings - Fork 661
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
Make UnitEnum name property non-empty #6964
Conversation
Thanks, that's great! |
Hi @orklah, it seems I made a mistake somewhere: https://psalm.dev/r/1bf1de16e0 Any idea why this PR didn't fix this? |
I found these snippets: https://psalm.dev/r/1bf1de16e0<?php
interface A {
/**
* @return non-empty-string
*/
public function getName(): string;
}
enum B implements A {
case Test;
public function getName(): string
{
return $this->name;
}
}
|
Yeah, sorry, I should have thought about that, there's special code for handling ->name on enums here: psalm/src/Psalm/Internal/Analyzer/Statements/Expression/Fetch/AtomicPropertyFetchAnalyzer.php Line 205 in 39402c2
I wonder if we could drop the whole block now that we have a stub... Do you mind trying that? If it doesn't work, then we need to replace Type::getString by a Type::getNonEmptyString() |
I'll look into it! |
So I tried flat-out removing the |
that's fine, thanks for your help! |
No description provided.