IDE compatibility with getData()
#57
Unanswered
HandsomeStrife
asked this question in
Q&A
Replies: 1 comment
-
Hi @danives, Hmm, I don't think such a thing is possible at the moment, sadly enough 😢 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hey - am loving the Data package, and currently using it in conjunction with the event sourcing package.
However, the issue I'm facing at the minute stems from using the
getData
function off of Models, via theWithData
trait; namely as I'm type hinting my methods to expect the data class I'd expect, but with PHPStorm I'm seeing warnings such as:due to the fact that the getData class specifies Data being returned. Probably a needless example, but just to show a code snippet/explanation of what's going on:
Currently I'm getting around these warnings in the IDE by defining the data in a docblock, or by wrapping it in ::from e.g.
I wondered if anyone had come across a similar issue and knew of a better solution? I'd much rather use
->getData()
than::from
as I feel it's a little nicer, but if it's the tradeoff then that's fine :)Thanks!
Beta Was this translation helpful? Give feedback.
All reactions