Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ext-ds usages not detected #87

Closed
simPod opened this issue Jun 7, 2020 · 8 comments · Fixed by #88
Closed

ext-ds usages not detected #87

simPod opened this issue Jun 7, 2020 · 8 comments · Fixed by #88

Comments

@simPod
Copy link
Contributor

simPod commented Jun 7, 2020

Describe the bug

I'm heavily dependent on ext-ds however it is reported as unused. I wonder why and what can I do to fix it.

Error dump

{"time":"2020-06-07T13:54:35.809084+00:00","level":"info","message":"version","context":{"value":"0.7.0"}}
{"time":"2020-06-07T13:54:35.809421+00:00","level":"info","message":"requires","context":{"php-64bit":"^7.2","ext-ds":"*"}}
{"time":"2020-06-07T13:54:35.809441+00:00","level":"info","message":"dev-requires","context":{"icanhazstring\/composer-unused":"^0.7.3"}}
{"time":"2020-06-07T13:54:35.809461+00:00","level":"info","message":"autoload","context":{"psr-4":{"SimPod\\Bugs\\":["src\/"]}}}
{"time":"2020-06-07T13:54:35.809480+00:00","level":"info","message":"dev-autoload","context":[]}
{"time":"2020-06-07T13:54:35.843243+00:00","level":"debug","message":"Parsing file \/Users\/user\/Work\/bugs\/src\/Example.php","context":[]}

Additional information

This is to reproduce simPod/php-bugs@e539a75

@icanhazstring
Copy link
Member

Hi @simPod thanks for reaching out.

This is really strange. Will check into that to see if the defined symbols in the package might not be recognized correctly.

@icanhazstring
Copy link
Member

HI @simPod good news. I could identify the issue.
Problem is that ext-ds is using a namespace for its classes, whereas core and everything else I encountered so far, is not using namespaces for classes/functions or anything.

I will need to come up with a good test to cover this (also for other extensions that might use namespaces). Shouldn't take that long, so stay tuned 👍

@icanhazstring
Copy link
Member

icanhazstring commented Jun 10, 2020

You can try it with :dev-master version. Tag will come asap.
If something is still not working, do not hesitate to reopen this issue.

@simPod
Copy link
Contributor Author

simPod commented Jun 10, 2020

@icanhazstring RdKafka extension is also using namespaces. Tested with master and works with both. However, interesting is that 0.7.3 does not seem to have the issue with ext-rdkafka.

@icanhazstring
Copy link
Member

icanhazstring commented Jun 10, 2020

Funny side note: Using the AST the node which represents the "used instance" is broken down into parts separated by \. With ext-rdkafka there is class called RdKafka which fits into the usage of RdKafka\Consumer class. So only the first part gets matched.

With ext-dsthis didn't work, because there is no Ds class inside the extension. ;)

@simPod
Copy link
Contributor Author

simPod commented Jun 10, 2020

2b0770b248e05f26b5d697da196a74b3

@icanhazstring
Copy link
Member

Tagged as 0.7.4

@simPod
Copy link
Contributor Author

simPod commented Sep 16, 2020

Wrks, thx!

@simPod simPod mentioned this issue Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants