Skip to content

Conversation

@kkmuffme
Copy link

@kkmuffme kkmuffme commented Dec 7, 2025

Fix #264

Copy link
Contributor

@mspirkov mspirkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you don't want to wait for the second version, where this problem is solved?

@kkmuffme
Copy link
Author

kkmuffme commented Dec 7, 2025

Given the current rate of updates/development with nobody having time anymore for tooling (myself included if you look at the progress or lack thereof in psalm), it's probably going to be 2028 by the time the tools I need this for is updated to v2 (which again is mostly due to me not having time :-(

Btw is "non-falsy-string" fixed in v2 too?

@mspirkov
Copy link
Contributor

mspirkov commented Dec 7, 2025

I plan to add support for non-falsy-string and some other types soon.
This means that in the second version this type will be supported

Copy link
Member

@jaapio jaapio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs some tests. You can have a look at the other tests of type resolver to see how to do this. I cannot accept changes without a test.

Comment on lines +663 to +681
return $type instanceof String_ ||
$type instanceof CallableString ||
$type instanceof HtmlEscapedString ||
$type instanceof IntegerRange ||
$type instanceof IntegerValue ||
$type instanceof IntMask ||
$type instanceof IntMaskOf ||
$type instanceof KeyOf ||
$type instanceof LiteralString ||
$type instanceof LowercaseString ||
$type instanceof NegativeInteger ||
$type instanceof NonEmptyLowercaseString ||
$type instanceof NonEmptyString ||
$type instanceof PositiveInteger ||
$type instanceof StringValue ||
$type instanceof ClassString ||
$type instanceof InterfaceString ||
$type instanceof TraitString ||
$type instanceof Integer;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need to include all of this, the string and integer type variants are extending the String_ or Integer class. The actual problem you solved is in the way you handle the compound type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants