NodeScopeResolver analysed files not as global state and optional
@ondrejmirtes We discussed this on our friday call. I prepared PR that would make NodeScopeResolver usable for our use case of collecting latte templates context.
-
analysedFilesare not global state anymore but passed as optional parameter toresolveNodesandresolveStmtNodes - It is optional parameter - when omitted
NodeScopeResolverwill not limit what traits it resolves
I split resolveStmtNodes to public resolveStmtNodes which can set analysedFiles and private iterateStmtNodes used internally in NodeScopeResolver to avoid reseting analysedFiles or passing it arround all private methods of NodeScopeResolver
Now I see this global state is used by rector. Would you preffer to just make it optional and kept as global state? It would be enough for our use case. I just want to remove global state when I was already making changes to it.
Or make setAnalysedFiles public and mark it as deprecated?
I created simpler version that only makes setting analysedPaths optionsl for NodeScopeREsolver (used to limit analysis of trait outside of analysedPaths). See #2123