Repository navigation
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)? |
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...) |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
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\MethodIdentifiermoved to@internalwhich now of course causes plsalm to raiseInternalClassissues.What's the best practice for writing plugins? In this case, this happens in an
afterMethodCallAnalysismethod where I'm trying to get to aMethodStoragethrough$event->getCodebase()->methods->getStorage()but that needs aMethodIdentifierwhich I'm now told I shouldn't be instantiating.So the question is:
\Psalm\Internal(feels wrong)?All reactions