Comments (3)
I think you can have 2 kind of configs for that, eg:
rector.php
without importrector-with-import.php
with import
then, in your rector-with-import.php
, you can do:
return static function (RectorConfig $rectorConfig): void {
$rectorConfig->import(__DIR__ . '/rector.php');
$rectorConfig->importNames();
};
so you can run rector-with-import.php
on separate command when you want to change it:
vendor/bin/rector process --config rector-with-import.php
or vice versa so you can review as another individual change.
from rector.
@samsonasik Sorry, but I don't understand how exactly it helps in my case.
If I want to go throughout the code applying a rule that changes interface usage to an attribute (in my case - MessageHandlerInterfaceToAttributeRector), it will either
A) [without importNames()] Update only the files I need but use annotation with the full namespace like this:
#[\Symfony\Component\Messenger\Attribute\AsMessageHandler]
class Foo
{
}
B) [with importNames()] It will add correct annotation with the short class name:
use Symfony\Component\Messenger\Attribute\AsMessageHandler;
#[AsMessageHandler]
class Foo
{
}
But it will also change full class name usages throughout all my code, which is huge.
So, there is no option C) at the moment, where I'd get short class for the attribute, and it won't change all other files which I didn't want to affect. I don't understand how having 2 separate config files may help me.
from rector.
It was removed due to avoid too detailed setup and making ambiguous code, see PR:
You can have as many config as needed for your use case, then run separately with --config
argument in CLI.
Thank you for understanding.
from rector.
Related Issues (20)
- [DX] Make withSkip() report rules that are ignored, but never registered HOT 3
- Incorrect behavior of RemoveExtraParametersRector on variadic functions in abstract class calling extending class
- Incorrect behavior of FirstClassCallableRector with private methods HOT 1
- Better behavior of ReadOnlyClassRector
- 'join' alias is not processed by ConsistentImplodeRector.php HOT 2
- Incorrect behavior of BooleanInBooleanNotRuleFixerRector HOT 1
- Incorrect behavior of ReduceAlwaysFalseIfOrRector HOT 2
- "System error: "Call to undefined method PHPStan\PhpDocParser\Ast\PhpDoc\PhpDocNode::getParamImmediatelyInvokedCallableTagValues()" HOT 2
- Php74 set renames non-deprecated apache_request_headers() function HOT 1
- New rule proposal: incorrect use of parenthesescan can cause unexpected behavior in code HOT 1
- Some public const enum values `types` are added on php 8.3 but on some it doesn't work. HOT 2
- Incorrect behavior of AssertRegExpRector HOT 1
- FirstClassCallableRector should also change simple function names
- Incorrect behavior of DowngradeThrowExprRector HOT 5
- Incorrect behavior of RemoveUnusedVariableAssignRector
- Incorrect behavior of NewInInitializerRector
- @param mixed type removed although there is a comment HOT 1
- [ERROR] Could not process "vendor/googleads/google-ads-php/src/Google/Ads/GoogleAds/Lib/V16/InfoRedactor.php" file, due HOT 9
- Explore way Rector or another tool can process blade templates
- [DX] Allow more granulated return type comletion, to separate from closures and makes easier to review
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rector.