Conversation
There was a problem hiding this comment.
Does strauss automatically handle namespace references in use statements? What about the strings containing \FontLib\Table\... references around line 400 in this file?
|
If the issue is around construction of a namespace in a string, you might also look at the Dompdf project. |
this is exactly related to dompdf. with this fix everything started working for us and it seems like there are no errors yet |
|
I'm curious why only these lines prove problematic. There is similar logic in elsewhere in FontLib as well as in Dompdf that builds a string containing a class reference. I would expect similar issues there. I suppose it's possible you're not hitting those in this library and that only FontLib is impacted because another dependency in your project is using the "FontLib" namespace. |
Maybe. There are no more moments like this in this library? |
In the file you modified there's this block: and in Dompdf there's a few, like this one: I'm fine to accept the change you made and wait to resolve others when they crop up. I'm not familiar with the tool you're using so I don't know what best practice would be to prevent potential rename misses. And I'm not planning to spend a lot of time researching it since it's not a primary usage scenario. |
|
(I maintain Strauss). It's really just a fancy find+replace for namespaces, classes etc. So, e.g. Dompdf can be used in multiple WordPress plugins without worrying about a different plugin's files being autoloaded but using a different version of the library It scans all the files, finds all the namespaces, then uses a big regex to substitute the change. In your example, changing but not with: so that explains why this PR was needed for the two cases it changes. TBH, I'm surprised it worked at all. But I've a regression test written now so we can rest knowing it will continue to work. There is an issue open about partial matches + strings and I'll look at this again when I'm tackling that. |
When we prefix namespaces with https://github.com/BrianHenryIE/strauss problems arise