-
Notifications
You must be signed in to change notification settings - Fork 39
Remove encoding writing stuff #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,16 +24,22 @@ abstract class FilteredStream implements StreamInterface | |
|
||
/** | ||
* @var resource | ||
* | ||
* @deprecated since version 1.5, will be removed in 2.0 | ||
*/ | ||
protected $readFilter; | ||
|
||
/** | ||
* @var callable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is an abstract class: isn't this a BC break too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Removing a non-private function in a non-final class is always a BC break. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In that case, the |
||
* | ||
* @deprecated since version 1.5, will be removed in 2.0 | ||
*/ | ||
protected $writeFilterCallback; | ||
|
||
/** | ||
* @var resource | ||
* | ||
* @deprecated since version 1.5, will be removed in 2.0 | ||
*/ | ||
protected $writeFilter; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this can be safely removed as it was always null and never used, even if it's BC i assume nobody use this (otherwise i really don't understand why xD) @dbu @sagikazarmark ok to remove this even if it's somehow BC (never used, always null value in a protected scope so ...) ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i tend to agree, but lets maybe leave as is, there is stuff to remove when we go 2.0 anyways so we can play it safe. does not add cost to leave those in |
||
|
||
|
@@ -47,12 +53,17 @@ abstract class FilteredStream implements StreamInterface | |
/** | ||
* @param StreamInterface $stream | ||
* @param mixed|null $readFilterOptions | ||
* @param mixed|null $writeFilterOptions | ||
* @param mixed|null $writeFilterOptions deprecated since 1.5, will be removed in 2.0 | ||
*/ | ||
public function __construct(StreamInterface $stream, $readFilterOptions = null, $writeFilterOptions = null) | ||
{ | ||
$this->readFilterCallback = Filter\fun($this->getReadFilter(), $readFilterOptions); | ||
$this->writeFilterCallback = Filter\fun($this->getWriteFilter(), $writeFilterOptions); | ||
$this->readFilterCallback = Filter\fun($this->readFilter(), $readFilterOptions); | ||
$this->writeFilterCallback = Filter\fun($this->writeFilter(), $writeFilterOptions); | ||
|
||
if (null !== $writeFilterOptions) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please add some spacing before and after? |
||
@trigger_error('The $writeFilterOptions argument is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); | ||
} | ||
|
||
$this->stream = $stream; | ||
} | ||
|
||
|
@@ -139,13 +150,41 @@ public function __toString() | |
* Returns the read filter name. | ||
* | ||
* @return string | ||
* | ||
* @deprecated since version 1.5, will be removed in 2.0 | ||
*/ | ||
public function getReadFilter() | ||
{ | ||
@trigger_error('The '.__CLASS__.'::'.__METHOD__.' method is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); | ||
|
||
return $this->readFilter(); | ||
} | ||
|
||
/** | ||
* Returns the write filter name. | ||
* | ||
* @return string | ||
*/ | ||
abstract public function getReadFilter(); | ||
abstract protected function readFilter(); | ||
|
||
/** | ||
* Returns the write filter name. | ||
* | ||
* @return string | ||
* | ||
* @deprecated since version 1.5, will be removed in 2.0 | ||
*/ | ||
public function getWriteFilter() | ||
{ | ||
@trigger_error('The '.__CLASS__.'::'.__METHOD__.' method is deprecated since version 1.5 and will be removed in 2.0.', E_USER_DEPRECATED); | ||
|
||
return $this->writeFilter(); | ||
} | ||
|
||
/** | ||
* Returns the write filter name. | ||
* | ||
* @return string | ||
*/ | ||
abstract public function getWriteFilter(); | ||
abstract protected function writeFilter(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be removed as well as the writeFilter