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

final keyword prefixed with classmap prefix #119

Closed
Dartui opened this issue Oct 2, 2024 · 1 comment
Closed

final keyword prefixed with classmap prefix #119

Dartui opened this issue Oct 2, 2024 · 1 comment

Comments

@Dartui
Copy link

Dartui commented Oct 2, 2024

Problem

  • download repository: https://github.com/Dartui/strauss-final-prefix
  • run composer install && composer prefix-namespaces to replicate issue.
  • go to dependencies/symfony/polyfill-php80/Resources/stubs/Attribute.php and see that class declaration has unwanted classmap prefix
image

I was able to narrow this error down to the vendor/symfony/console/CHANGELOG.md file which contains class final.

image

FileScanner@find method regexp recognizes this as valid class name (I guess), adds it as class symbol and then uses it to replace word final.

Solution

Simplest solution would be to scan only .php files for class discovery. Locally I did simple check that solved this issue, but I guess that for some reason scanning is not limited only to PHP files.

image
@BrianHenryIE
Copy link
Owner

I don't think there was any intent to scan more than just PHP files, rather it hasn't been an issue until now.

There are potentially other file types that could have replacements made in them, e.g. the Authorize.net SDK uses (used?) a SOAP XML file and it parsed that to know what classes were used for which endpoints. It'd be nice to have but hasn't been an issue for me in years.

Thanks for the detailed report, very helpful.

Fixed with 2e0a2f8...d046e3f; released in 0.19.3.

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

No branches or pull requests

2 participants