Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Spin-off from: #1807662: Built-in APCu support in core (PHP 5.5 only)
Attached patch fixes Missing method visibility, bogus phpDoc and coding style in Cache backend classes.
Comment | File | Size | Author |
---|---|---|---|
cache-cleanup.0.patch | 14.22 KB | sun | |
Comments
Comment #1
andypostNice!
Comment #2
webchickThese changes all seem fine to me, but probably best for catch to have a look since it touches the caching system.
Comment #3
Lars Toomre CreditAttribution: Lars Toomre commentedI will simply leave the following thoughts as comments with little expectation that they might be applied to this patch. If a fuller review is requested, please let me know.
I hope that I have made my point. Either there should be no type hinting or a complete application of type hinting. Somewhat is neither!!
Since type hinting is being added elsewhere in this patch, why not here?
Apparently type hinting is not required here either.
Again no type hinting? Curious about what the standard is with regard to this patch.
small nitpick: I believe our coding standards are for s/Array/array/. Please let me know if I am wrong.
Apparently no type hinting here is appropriate... *smiles*
Comment #4
catchYou can't type hint a scalar in PHP.
Comment #5
Lars Toomre CreditAttribution: Lars Toomre commented@catch My comments were about the @param and @return directives.
Comment #6
webchickThose lines are not being changed by the patch, so I've no idea why they would need to be typehinted.
Comment #7
Lars Toomre CreditAttribution: Lars Toomre commentedThanks for the comment @webchick.
Is this not adding a type hint?
Comment #8
webchickI'm reasonably convinced at this point that you're just trolling, but sure. I'll bite.
The difference is that:
Previous function had no type-hinting; adding it is scope creep.
@param was already type-hinted, type-hinting @return brings them in-sync.
Comment #9
Lars Toomre CreditAttribution: Lars Toomre commentedThanks @webchick. I truly appreciate your response.
From a DX perspective, let me address what $bin in #8 is suppose to be. Is it an integer or a string? Based upon the current documentation, it is very unclear. Hence, my advocacy for type hinting whatever gets added or changed via a patch.
I am not trolling at all, and am annoyed that you would suggest such. I am simply advocating that type hinting gets added to whatever gets added to or touched via a patch.
Comment #10
webchickYou're right; that comment was out of line, and I apologize.
And yes, I generally agree with type-hinting when code is changed (though actually requiring on RTBC patches depends on the outcome of #1792992: Are typed @param / @return part of the documentation gate?), but no actual code here is changed. It's simply making the function scoping explicit, and is essentially a coding standards fix. Actually documenting the typehints on all of these functions requires deep inspection of each of these, in order to analyze whether $bin is indeed a string or an object or a $whatever, and that's not what's happening here. Separate concern, separate patch.
Comment #11
Lars Toomre CreditAttribution: Lars Toomre commented@webchick You have hit the nail on top of its head.
Yes, this patch does not change any code lines. As you say it 'is essentially a coding standards fix' and most often such patches get moved to @jhodgdon's queue.
However, if I might para-phrase @jhodgdon correctly, committing type hint addition patches are very low on her radar because of the time required to review the proposed type hint change(s).
My simple goal in #3 is that while we are addressing code lines, let's also make sure that the the type hinting of whatever has been adjusted is accurate.
As an aside, I am at a loss about why documentation patches cannot include minor code fixes and vis-a-versa.
Comment #12
catchCommitted/pushed to 8.x, if there's more cleanup to do that can be done in a follow-up.