Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

kayw-geek
Copy link
Collaborator

Replace vendor patch mechanism with a custom PhpFileLoader implementation to support MBConfig without modifying
third-party code.

Problem

The project was using cweagans/composer-patches to patch Symfony's PhpFileLoader to support custom configurator
classes (like MBConfig). This approach had several issues:

  • Direct modification of vendor code
  • Potential conflicts during Symfony upgrades
  • Added complexity with composer-patches dependency
  • Against best practices of not modifying third-party code

Solution

Implemented a custom ParameterMergingPhpFileLoader that:

  • Dynamically resolves configurator class types through reflection
  • Supports MBConfig and any class extending ContainerConfigurator
  • Maintains backward compatibility with existing configuration files
  • Preserves parameter merging functionality

@kayw-geek kayw-geek force-pushed the bugfix/fix-mbconfig-dependent-injection branch 5 times, most recently from d00ade5 to db3e0a5 Compare August 14, 2025 03:29
…lve MbConfig loading issue and upgrade dependency packages
@kayw-geek kayw-geek force-pushed the bugfix/fix-mbconfig-dependent-injection branch from db3e0a5 to c148eac Compare August 14, 2025 03:32
@kayw-geek kayw-geek merged commit 6844e19 into symplify:main Aug 14, 2025
38 checks passed
@garrettw
Copy link
Contributor

Why did you remove the ECS and Rector checks from everything?

@kayw-geek
Copy link
Collaborator Author

Why did you remove the ECS and Rector checks from everything?

Use the main configuration uniformly

@garrettw
Copy link
Contributor

Oh, ok. So I may just need to update the main config to check the sub-packages then

@kayw-geek
Copy link
Collaborator Author

Oh, ok. So I may just need to update the main config to check the sub-packages then

Yes, you are right.

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 this pull request may close these issues.

2 participants