-
Notifications
You must be signed in to change notification settings - Fork 74
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
10.2: EntityReferenceTestTrait to EntityReferenceFieldCreationTrait rector using RenameClassRector #272
Open
bbrala
wants to merge
14
commits into
main
Choose a base branch
from
feature/entity-reference-trait
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+25
−0
Open
10.2: EntityReferenceTestTrait to EntityReferenceFieldCreationTrait rector using RenameClassRector #272
Changes from 9 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
90ad00c
EntityReferenceTestTrait to EntityReferenceFieldCreationTrait rector …
bbrala 6b538bd
Small typo
bbrala ee516bc
Add 10.2 set to config
bbrala fdbe1e0
When renaming it does not remove the old use statement. This should n…
bbrala d5c66a6
whitespace
bbrala 945e35f
order
bbrala 4dc15a9
Merge branch 'main' into feature/entity-reference-trait
agentrickard 9771c80
Merge in main; fix merge conflict.
agentrickard 606d8af
Add missing use statenemt
agentrickard 5e5c308
Merge branch 'main' into feature/entity-reference-trait
agentrickard 523fb71
Merge branch 'main' into feature/entity-reference-trait
agentrickard 4bc7eef
Merge branch 'main' into feature/entity-reference-trait
agentrickard 6522dfb
Fix style issue from the merge conflict.
agentrickard cb23643
Merge branch 'main' into feature/entity-reference-trait
agentrickard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
use Drupal\Tests\field\Traits\EntityReferenceTestTrait; | ||
|
||
class EntityReferenceItemTest extends FieldKernelTestBase { | ||
|
||
use EntityReferenceTestTrait; | ||
|
||
} |
10 changes: 10 additions & 0 deletions
10
fixtures/d10/rector_examples_updated/entity_reference_trait.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
use Drupal\Tests\field\Traits\EntityReferenceFieldCreationTrait; | ||
use Drupal\Tests\field\Traits\EntityReferenceTestTrait; | ||
|
||
class EntityReferenceItemTest extends FieldKernelTestBase { | ||
|
||
use EntityReferenceFieldCreationTrait; | ||
|
||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
@bbrala should we wrap this with a BC protection? I guess then we'd need to extend
RenameClassRector
and a config object to do so :/ or is there an easier way?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.
Yeah we need to wrap. I've wanted to wrap for a few times now, but haven't taken the time to see if its ewasily possible.
You'd need to do quite a few weird things to make sure things are instantiated correctly. Would open up loads of easy things like this rector though.
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.
Since all classes in rector are final, there is no extending.
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.
I believe this PR is held up for the BC refactor?
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.
Yeah pretty much. Just feels like a lot of effort for 10.1 vs 10.2... Although the pattern might be usefull later.
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.
Ok, visited this again. Something generic is very hard. Something expanding on what RenameClassRector does AND hooking into the file is kinda hard.
So guess it needs a specific rector for this change, which is sad. And my time is up for today ;x