[Bug]: nette/php-generator
do not take care of replacements before converting FQCNs
#867
Labels
nette/php-generator
do not take care of replacements before converting FQCNs
#867
Tempest Version
dev-main
PHP Version
8.4
Operating System
Windows
Description
Working with make commands or in general with the
nette/php-generator
wrapper from Tempest ( inClassManipulator
for example ).I wanted to make replacements in the stub file to replace a string by a FQCN.
I therefore expected that the replacements will transform the string to my FQCN and then the
ClassManipulator
will convert the FQCN in method body to class short name and use statement. ( located inSimplifiesClassNames::extractFqcnFromBody()
It seems like the replacements are made after the
extractFqcnFromBody
.I suggest to dig it and check if we can just reverse the order or if this require further tweaks.
I also don't know if reversing the order could break anything or not.
Steps to Reproduce
Have a stub file like this :
If we add replacements via the
StubFileGenerator
like this :Then the FQCN stay there without being processed to be shortened
The code is run through abstractions but the main instructions are those ones :
The text was updated successfully, but these errors were encountered: