Closed (fixed)
Project:
Drupal core
Version:
11.x-dev
Component:
other
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 May 2016 at 20:00 UTC
Updated:
17 Jun 2025 at 23:47 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anoopjohn commentedPlease find a patch that attempts to fix all but 4 of the reported errors. It would be good if somebody else could chip in with the fixes for the four remaining errors. I have attached the errors that have to be looked into though.
Also the patch will have to be reviewed carefully as there are code changes to reflect some of the comments as I felt that there were comments that served to document some of the functions in classes that were expected to be overridden by child classes. I think there were genuine errors in terms of omitted return statements in some of the functions. Not sure if these were to be created as separate issues eg: node_revision_delete in node.module
Comment #3
anoopjohn commentedComment #4
mile23Ooo a thorny one. :-)
If these code changes are made to match the documentation, then they're bugs and should be a separate issue against 8.1.x.
I'm really kind of amazed that tests passed with these changes, for at least two reasons. :-)
Beyond that, the doc changes will require careful examination of the methods to review.
Comment #5
anoopjohn commentedThe first three are functions that are to be overridden by inherited classes and hence the errors when not overridden. So by default these functions should not have resulted in any test failures right?
I have raised separate issues for the node_revision_delete return #2737743: node_revision_delete() not returning bool in node.module as well as the getUUid return #2737741: Drupal\menu_link_content\Plugin\Menu\MenuLinkContent::getUuid() does not return any value issues.
Remove the last two from the patch? What about the first three? What needs to be done there?
Comment #6
anoopjohn commentedComment #7
mile23Let's just postpone this until the other issues are fixed, because we shouldn't patch phpcs.xml.dist before they are.
Comment #11
mfernea commentedThis is also blocked by #2906931: False positives for Drupal.Commenting.FunctionComment.InvalidNoReturn - Yield statement.
Comment #15
idebr commentedThe blocking issues are committed, so this issue is now unblocked.
Comment #19
longwaveComment #20
abhisekmazumdarTried to re-roll the patch from #2.
Comment #21
longwaveThanks for the reroll.
I ran phpcs across the whole codebase and found a few more issues and tried to fix them. Two issues remain:
For the case of \Drupal\Core\FileTransfer\FileTransfer:
Can't we just declare this method abstract?
In \Drupal\Core\Database\Schema:
I'm not sure what to do here, as adding a dead-code return seems wrong as well.
Comment #22
daffie commentedI do not see why this change is needed. The method returns a boolean value.
This change is wrong.
$this->connectionis not a PDO object. Lets make the method an abstract method as every by core supported driver implements the method as does the ones for SQL Server and OracleDB. Also, the method now does not work for any driver. Lets change the code to:abstract public static function open(array &$connection_options = []);.Can we change these parameter documentation to:
@param array &$schema.As we are returning null here the return value in the docblock must be changed to:
@return string|null.+1 for me. In its docblock it is saying: "lasses that extend this class must override the factory() static method. They should return a new instance of the appropriate FileTransfer subclass.".
Comment #23
andypostMaybe instead of removal of return null, use void?
Comment #24
ravi.shankar commentedAdded reroll of patch #21.
Comment #25
longwave@andypost PHPDoc standards say "@return void" can be omitted when methods do not return anything: https://docs.phpdoc.org/3.0/guide/references/phpdoc/tags/return.html#return
Comment #26
longwaveAddressed all comments in #22, also cleaned up one more docblock to use inheritdoc instead of "Overrides..." and reworded the ImageTest mock setup methods as they don't "Get" anything really.
Comment #28
renatog commentedWe should include a full stop on this comment
The link definitions to be altered. Each link has a key that is the machineIt can be a problem because with 1 more char it'll have more than 80 chars and we need to split in a second line
Comment #29
longwave@RenatoG I don't think a full stop needs adding, the first line is being replaced but the sentence continues on the next line:
Comment #30
longwaveImplemented two abstract methods in test classes.
Comment #31
renatog commentedYes, it's true @longwave/ It really makes sense
#30 looks good
Comment #32
andypostIt could use follow-up looking on winning
neverfor PHP 8.1 https://wiki.php.net/rfc/noreturn_typeComment #33
alexpottThese are API changes that we shouldn't be making in a coding standards change. The FileTransferException seems more okay but it should get its own issue. The introspectIndexSchema is definitely not okay. This method exists only for testing purposes - see SchemaIntrospectionTestTrait - that's the only place this stuff is called. There's no need for a contrib driver to declare this method and making this change could break a contrib driver.
Comment #39
quietone commentedRerolled and also made a few changes so the commit code checks pass locally.
Comment #40
quietone commentedComment #41
quietone commentedMake changes for #33.
Comment #42
quietone commentedRemove lines from phpstan-baseline.neon
Comment #43
quietone commentedRestore drupalci
Comment #44
smustgrave commentedHave not reviewed
Seems to have a failure in #43
Comment #45
quietone commentedSeems that I did not restore drupalci.yml as I intended.
Comment #46
smustgrave commentedAt first was confused why it was removing return statement and realized they weren't used haha.
Think this is an excellent cleanup idea and will keep the comments very clean.
Comment #48
quietone commentedUnrelated failure. Retesting
Comment #49
quietone commentedTests are passing, restoring RTBC
Comment #50
spokjeComment #51
quietone commentedI'm triaging RTBC issues.
I looked at this late last night and after reading the IS and comments I don't see anything left to do.
Today, I skimmed the code and found this.
This looks wrong.
I removed that line and made a new patch.
Comment #52
quietone commentedRemoving that unusual comment hasn't cause any test failures. I think it is OK to restore the RTBC here.
Comment #53
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #54
quietone commentedA simple reroll due to changes in the phpstan baseline.
Comment #55
smustgrave commentedReroll looks gook. All green.
Comment #56
longwave#54 failed standards checks:
Comment #57
quietone commentedUpdate for changes made in #3364706: Refactor transactions.
Comment #58
quietone commentedIt is a simple reroll, restoring RTBC
Comment #59
xjmWow, got a lot more than I expected here. Thanks everyone for your work on this suprisingly challenging issue.
As I started reviewing this I quickly concluded that the change set is way too broad. We are mixing three things:
So, I think we need to split this up. I think there should be:
Since the only real code reviews so far are mostly related to the issues in the DB API docs, I think maybe we should create a new meta, and convert this to be the child about DB issues, moving the existing code to the meta (I'd created a combined MR on the meta) and then child issues as appropriate.
Also, API docs issues are much easier to review in GitLab than in patches, because the reviewer needs to be able to read the code that the docs are about. With a diff of a docblock in a patch, I have to open the class locally or on api.d.o, find the relevant lines, and compare. On GitLab I can just expand the shown lines in the same interface I'm doing the review. So, let's go with MRs for this and all the other issues we'll split off.
My notes from the code review I started are below:
Unlike most of the changes, this is a place where the documented behavior is different from what actually happens, which could indicate an underlying bug. Have we researched this? (Will check after I post my diff review.) I think this should also be a separate scope, possibly with tests.
Edit: Same with the DB connection method.
Isn't this documentation redundant with the
@throws? Maybe it's worth explaining because it's odd for the method not to return a status, but OTOHConfigBase::validateName()has the same behavior already with no docs change here. So, if anything, I think this is out of scope and should be in a followup if we want to improve the docs like so.This is an actual behavior change and seems like it needs its own issue, with tests.
Sorry to be a downer but there is a lot more needed here, and we can get at least parts of it in faster if we split it up. Thanks everyone!
Comment #60
quietone commentedDowner indeed. :-(
Converting to a Meta
Comment #61
quietone commentedComment #62
quietone commentedComment #63
quietone commentedComment #64
quietone commentedComment #65
quietone commentedComment #66
quietone commentedComment #67
quietone commentedThank you to everyone who helped to complete this issue. The last child was recently committed. So, I am closing this as fixed.
Comment #69
xjmAmending attribution.