deptrac
deptrac copied to clipboard
[WIP] Add ClassMethodResolver to determine return types by Method returns
a new try to resolve #449 See also #454 as base POC pull request
The following cases are not resolved:
- [ ] test with multiple return types
- [ ] return types with
@var
annotations are not supported - [ ] test for array return types
And some other tasks where i'm glad to get some help:
- [ ] how to resolve the return types by annotations
- [ ] i use a own variablesCache which doesn't look very good. But i don't know how the variables in the scope are stored.
@marcelthole I had a look at your PR, great work so far! As for the things you are looking for help with:
- variable cache - I think your solution is absolutely fine, I would not have done any differently
- resolving types by annotation - I would use already existing
AnnotationDependencyResolver
. You already have$typeScope
passed into yourClassMethodResolver
. For$node
you would use yourmethodCall
node and for$referenceBuilder
you would have to create a new class or reuseFunctionReferenceBuilder
and rename it to something akin toFunctionLikeReferenceBuilder
.
If you need any more help, feel free to reach out. I have re-written a substantial part of the current AstRunner so I know my way around it.
@marcelthole I am closing this PR as it has had no progress for almost 2 years. Also the solution is more complicated than what is being implemented there, as you can see in the original issue.