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.
Problem/Motivation
While working on #1308152: Add stream wrappers to access extension files I found this: Instead of calling the parent method LocalStream::stream_open()
, \Drupal\Core\StreamWrapper\LocalReadOnlyStream::stream_open()
is duplicating the code.
Proposed resolution
Cleanup.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#2 | remove_code_duplication-2751351-2.patch | 1.69 KB | claudiu.cristea |
Comments
Comment #2
claudiu.cristeaComment #3
claudiu.cristeaComment #4
claudiu.cristeaComment #5
claudiu.cristeaComment #6
claudiu.cristeaComment #7
claudiu.cristeaComment #8
timmillwoodGood, valid, clean up!
I think my only nit pick would be a couple of inline comments to explain what this is doing different to the parent, because we are now losing the
* Any write modes will be rejected, as this is a read-only stream wrapper.
comment.Comment #9
claudiu.cristea@timmillwood, thank you for review. I was tempted to add a comment but then I saw this line that seems self-explanatory for me:
Comment #10
timmillwood@claudiu.cristea - Yeh, I just wonder if it'd be move evident if bubbled up in a comment rather than in a function call. Although not overly precious about this, which is why I RTBC'd it rather moving it to needs work.
I guess whichever core committer looks at this can decide to add a comment or not on commit.
Comment #11
alexpottCommitted f84b2a1 and pushed to 8.2.x. Thanks!
As a task this is only eligible for 8.2.x - I agree with @claudiu.cristea - I think the code and trigger_error is self documenting.
Comment #13
claudiu.cristea