-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
QA: Replacement test case for 3rd party class containing ZendForm in its full path #94
Conversation
Signed-off-by: Patrick Braun <[email protected]>
Does it just get a new class alias though? Shouldn't break anything, unless you run into weird collisions 🤔 |
The problem is that the 3rd Party Library, which is contained in the vendor folder, is not renamed through the
After post processor:
At runtime the autoloader tries to load Possible solutions:
The project maintainer is responsible for adding exceptions to the renaming process. It looks like this was planned, because What do you think? |
Per a suggestion in laminas#94, this patch modifies the `ConfigPostProcessor` such that it now examines the merged configuration passed to it for its own configuration, specifically for replacement rules. These may be provided via the following configuration: ```php return [ 'laminas-zendframework-bridge' => [ 'replacements' => [ 'to-replace' => 'replacement', // ... ], ], ]; ``` This configuration itself will NEVER be rewritten. However, the rules will now be used as additional replacements when running the processor. Signed-off-by: Matthew Weier O'Phinney <[email protected]>
Signed-off-by: Patrick Braun [email protected]
Description
Corresponding test to issue #93
Adds unit test that is currently failing because the replacement rules replace the word ZendForm in 3rd party paths, which it should not do.
How to reproduce
Try to use a custom class that contains "ZendForm" somewhere in its class path, it'll get renamed to LaminasForm.
Expected:
CustomZendFormBinder => CustomZendFormBinder
Actual:
CustomZendFormBinder => CustomLaminasFormBinder