Problem/Motivation

ReadOnlyStream and LocalReadOnlyStream share almost the same code. Also PhpStreamWrapperInterface misses a lot of documentation that is present now in the 2 abstract classes.

Proposed resolution

  1. Create a ReadOnlyStreamTrait trait to deal with the code duplication.
  2. Fix corresponding documentation in PhpStreamWrapperInterface.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

claudiu.cristea created an issue. See original summary.

claudiu.cristea’s picture

Issue summary: View changes
claudiu.cristea’s picture

Status: Active » Needs review
FileSize
22.33 KB

Patch.

fietserwin’s picture

Status: Needs review » Closed (duplicate)

This is a duplicate of #2236163: Remove class ReadOnlyStream (or turn into a trait?).

Since the code that would be moved to the trait assumes there is a local file handle, it will only work for local read-only streams. So I see no use in placing it in a trait. let's just remove the ReadOnlyStream class to remove the duplication.

claudiu.cristea’s picture

I was thinking of that but you cannot because is a BC