-
-
Notifications
You must be signed in to change notification settings - Fork 371
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
Add RectorConfig for custom configuration methods and avoid conflicts with Symfony API #2019
Conversation
new e2e directory need to be register to e2e.yaml rector-src/.github/workflows/e2e.yaml Lines 25 to 32 in 0a6b3b3
|
a788326
to
c3c8bd0
Compare
custom config may need to be conditionally checked rector-src/.github/workflows/e2e.yaml Lines 53 to 55 in 0a6b3b3
|
Hm 🤔 We should automate this with some script. |
custom config check need to be checked as well rector-src/.github/workflows/e2e.yaml Lines 57 to 59 in 0a6b3b3
with https://github.community/t/and-operator-in-if-condition/154825
also in line 64 with
|
@samsonasik > custom config check need to be checked as well I see. I've just copy-pasted another directory, this can be in the root. I've moved it to avoid this one. Thanks |
"symfony/dependency-injection": [ | ||
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/symfony-dependency-injection.patch" | ||
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/symfony-dependency-injection.patch", | ||
"https://raw.githubusercontent.com/rectorphp/vendor-patches/main/patches/symfony-php-config-loader.patch" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this PR is merged, line needs to update in each Rector split repository's composer.json
, so we have the same patched Symfony everywhere
8eff286
to
c04ce87
Compare
target-repository e2e may need update, for example on global install e2e https://github.com/rectorphp/rector-src/tree/main/build/target-repository/e2e/global-install |
packages/Config/RectorConfig.php
Outdated
final class RectorConfig extends ContainerConfigurator | ||
{ | ||
/** | ||
* @param string[] $paths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@param mixed[] $paths
may be used when next Assert::allString($paths)
is checked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- Stable public API for configuring services - Rector rule for migrating Symfony configurator to Rector configurator
1f9e16e
to
60e533f
Compare
Let's 🚢 it 👍 |
60e533f
to
30506cf
Compare
Follow up to #1891
Using Symfony container for
rector.php
configuration is handy for autocomplete, static analysis and re-use of Symfony DI container.Yet, it has few drawbacks, when it comes to a project that runs on Symfony with it's own Symfony DI. There 2 classes of same name can conflict in IDE and come to an autoloading issue. See rectorphp/rector#7035 for more.
@Wirone came with a great idea, to have an own configurator class, that will be tailored to Rector's needs and features.
Similar to Config Builder Classes from Symfony: https://symfony.com/blog/new-in-symfony-5-3-config-builder-classes
How do we use
rector.php
now?How could we use
RectorConfig
in future?