Writing plugins and using internal classes #8851
pilif
started this conversation in
Plugin development
Replies: 2 comments 1 reply
-
Hmm, Codebase provides multiple method used to work with indirectly with method storages, why exactly do you need to fetch the storage instead of for example its parameters (Codebase::getMethodParams) or its return type (Codebase::getMethodReturnType)? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Honestly, the whole plugin API would need to be extracted, documented and clarified... (We don't really have a plugin API in fact, it's using internal functions mainly...) |
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
-
I'm in the process of updating our decade-old codebase from psalm 4.30 to psalm 5.1.0.
To help psalm with some of our legacy type-system, let's call them hacks, we employ a few plugins to mark methods as used and some return type provider.
However, now in psalm 5, I noticed that many classes we were using in the plugins, like
\Psalm\Internal\MethodIdentifier
moved to@internal
which now of course causes plsalm to raiseInternalClass
issues.What's the best practice for writing plugins? In this case, this happens in an
afterMethodCallAnalysis
method where I'm trying to get to aMethodStorage
through$event->getCodebase()->methods->getStorage()
but that needs aMethodIdentifier
which I'm now told I shouldn't be instantiating.So the question is:
\Psalm\Internal
(feels wrong)?Beta Was this translation helpful? Give feedback.
All reactions