- Issue created by @Lendude
- Status changed to Needs review
almost 2 years ago 3:16pm 9 February 2023 - 🇳🇱Netherlands Lendude Amsterdam
This starts with the easy bit, renaming variables, lets see what that breaks.....
The last submitted patch, 2: 3340621-2.patch, failed testing. View results →
- last update
over 1 year ago Custom Commands Failed - 🇮🇳India urvashi_vora Madhya Pradesh, India
Hi,
I am providing a patch for latest code of 11.x branch. Since the patch provided in #2 failed.
Steps performed:
1. Taken pull of latest code from 11.x
2. Search the code for 'resultset'
3. Replaced all appropriate appearances with 'result_set' (Excluded comments)Providing patch and interdiff. Please review.
Thanks
- Status changed to Needs work
over 1 year ago 2:02pm 1 August 2023 - 🇺🇸United States smustgrave
Don't think the variables need to be updating, especially since some of them are mixing cases.
Also a dictionary rule should be added I think.
- 🇳🇿New Zealand quietone
@urvashi_vora, thanks for updating the patch and commenting on how you modified the patch!
The wiki has details of the Naming Conventions → used by Drupal. That should help while working on this issue.
-
+++ b/core/lib/Drupal/Core/Database/StatementIteratorTrait.php @@ -18,7 +18,7 @@ trait StatementIteratorTrait { + private mixed $result_setRow = NULL;
This should be result_set_row
-
+++ b/core/lib/Drupal/Core/Database/StatementIteratorTrait.php @@ -26,7 +26,7 @@ trait StatementIteratorTrait { + private int $result_setKey = -1;
result_set_key
I searched for
resultset
incore/misc/cspell/dictionary.txt
and didn't find it, so that doesn't need to change.As for the errors they are from
./core/phpstan-baseline.neon
. You need to go through that file and delete all the error messages that are being fixed in this issue. -
- 🇮🇳India urvashi_vora Madhya Pradesh, India
@quiteone, thanks for the information. I will go through the Naming conventions and will try to provide a updated patch soon.
- Status changed to Needs review
over 1 year ago 6:10am 2 August 2023 - last update
over 1 year ago Custom Commands Failed - last update
over 1 year ago Patch Failed to Apply - 🇮🇳India urvashi_vora Madhya Pradesh, India
Hi,
I updated the patch as per the suggestions from #7 for mixed case variable. Uploading the updated patch.
Please review.Also, @quietone, I didn't find any related errors in
./core/phpstan-baseline.neon
, so haven't touched it.Please guide me for the next steps that I have to do in the case we need to modify
./core/phpstan-baseline.neon
.Thanks.
- last update
over 1 year ago 29,946 pass - 🇮🇳India urvashi_vora Madhya Pradesh, India
Thanks for updating the patch @_utsavsharma
- Status changed to Needs work
over 1 year ago 5:37pm 9 August 2023 - Status changed to Needs review
over 1 year ago 11:56am 10 August 2023 - last update
over 1 year ago 29,958 pass - 🇮🇳India urvashi_vora Madhya Pradesh, India
Hi, updated the patch, please review.
Thanks
- Status changed to Needs work
over 1 year ago 2:52pm 11 August 2023 - 🇺🇸United States smustgrave
Thanks for addressing those! But for comments I believe it should be result set vs result_set as that's a variable name
- 🇮🇳India urvashi_vora Madhya Pradesh, India
Got it, thanks @smustgrave. I will provide a patch soon
- Status changed to Needs review
over 1 year ago 3:46pm 11 August 2023 - last update
over 1 year ago 29,958 pass - Status changed to RTBC
over 1 year ago 5:40pm 11 August 2023 - last update
over 1 year ago 29,958 pass - last update
over 1 year ago 29,959 pass - Status changed to Needs work
over 1 year ago 5:54pm 16 August 2023 - 🇬🇧United Kingdom longwave UK
-
+++ b/core/lib/Drupal/Core/Database/StatementIteratorTrait.php @@ -11,14 +11,14 @@ private bool $isResultsetIterable = FALSE; ... - private mixed $resultsetRow = NULL; + private mixed $result_set_row = NULL; @@ -26,45 +26,45 @@ trait StatementIteratorTrait { - private int $resultsetKey = -1; + private int $result_set_key = -1;
Coding standards says:
Be consistent; do not mix camelCase and snake_case variable naming inside a file.
Therefore I think these should become
$resultSetRow
and$resultSetKey
. -
+++ b/core/modules/block_content/tests/src/Kernel/Views/RevisionRelationshipsTest.php @@ -82,19 +82,19 @@ public function testBlockContentRevisionRelationship() { - $this->assertIdenticalResultset($view, $resultset_id, $column_map); + $this->assertIdenticalResultset($view, $result_set_id, $column_map);
We could rename the method as well; method names are not case sensitive so this is backward compatible.
-
- Status changed to Needs review
over 1 year ago 6:57am 17 August 2023 - last update
over 1 year ago Custom Commands Failed - 🇮🇳India urvashi_vora Madhya Pradesh, India
Hi @longwave,
I have updated the patch with your suggestions, but I have a query, if you could please help me here, it would be great.
I need more elaboration of (2) point from #19. Actually, when I was replacing in I found out that the actual method is rendering from "Drupal\views\Tests\ViewResultAssertionTrait::assertIdenticalResultset" which is also with small "s". And this method is being called at multiple places in multiple files, do we need to replace it everywhere including the "ViewResultAssertionTrait.php" file?
Thanks
- last update
over 1 year ago Custom Commands Failed - 🇮🇳India urvashi_vora Madhya Pradesh, India
I updated the patch provided in #20, because as per (1) of #19, I mistakenly left small "s" in the variable name. Please review the updated patch. And still I have the same query which I mentioned in #20.
- last update
over 1 year ago 29,971 pass - last update
over 1 year ago Patch Failed to Apply - 🇮🇳India urvashi_vora Madhya Pradesh, India
Due to custom command fails, I again updated the patch, by changing the instances of updated variable.
Please review.
Thanks
- Status changed to RTBC
over 1 year ago 1:27pm 21 August 2023 - last update
over 1 year ago 30,056 pass - last update
over 1 year ago 30,056 pass - Status changed to Active
over 1 year ago 12:47am 25 August 2023 - 🇳🇿New Zealand quietone
I'm triaging RTBC issues → .
The IS comments that 'resultset' may not be in the Drupal dictionary. Indeed, it is not so 'resultset' is not considered a misspelling. So, what dictionary says it is valid? The results of
yarn cspell track 'resultset'
show that it is in the php dictionary. Since that is the case should we even be making this change? I very much wish I had done this in #7!I also see that the question in #20 has not been answered. And related to that there are two instances where
assertIdenticalResultset
has been changed toassertIdenticalResultSet
whereas all the others are unchanged.But again, are we sure we want to do this since this is a valid spelling according to the php dictionary? I am inclined to say no.
I am setting this back to active for a rethink of this.
- 🇧🇪Belgium BramDriesen Belgium 🇧🇪
RE #25. Personally I would agree that it doesn't really make sense to go against the PHP dictionary. Also not sure this is worth such a large refactoring. I think it's ok to accept both, as even in the official PHP docs, both versions are being used.
- Status changed to Closed: works as designed
10 months ago 1:20am 9 February 2024 - 🇳🇿New Zealand quietone
I checked with @Lendude in Slack, as the author of this issue, and he replied that he recalls this was opened in response to a comment by xjm in another issue. He continued on to say that "it feels very disruptive for very little gain".
So, given that and that 'resultset' is in the php dictionary let's leave close this.
Thanks to everyone who spent time here to improve Drupal!