psalm: Invalid MissingDependency error
Running psalm 4.4.0 on PHP 7.2 shows error SimpleXMLElement depends on class or interface stringable that does not exist
for any reference to SimpleXMLElement
.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 19 (10 by maintainers)
Commits related to this issue
- Use PHP 8.0 in CI https://github.com/vimeo/psalm/issues/5007#issuecomment-761189112 — committed to getkirby/kirby by lukasbestle 3 years ago
- Stubs: Don't explicitly depend on \Stringable Fixes #5007. — committed to lukasbestle/psalm by lukasbestle 3 years ago
- Stubs: Don't explicitly depend on \Stringable (#5037) Fixes #5007. — committed to vimeo/psalm by lukasbestle 3 years ago
- Stubs: Don't explicitly depend on \Stringable (#5037) Fixes #5007. — committed to danog/psalm by lukasbestle 3 years ago
@weirdan @orklah Thank you very much for the insights on the
phpVersion
option and flag. 👍Regarding this issue: Do we really need to have
implements \Stringable
in this line? As PHP 8.0 automatically adds theStringable
interface to every class implementing__toString()
, wouldn’t it be an alternative to include the method definition of__toString()
in theSimpleXMLElement
stub? This would make the stub compatible with all PHP versions.@orklah Ah, right! I misunderstood your message. It turns out there is already a test case for exactly this behavior, so we are fine.
I have fixed this issue in https://github.com/vimeo/psalm/pull/5037.