33namespace Http \Message \Encoding ;
44
55use Clue \StreamFilter as Filter ;
6- use GuzzleHttp \Psr7 \StreamDecoratorTrait ;
76use Http \Message \Decorator \StreamDecorator ;
87use Psr \Http \Message \StreamInterface ;
98
109/**
11- * A filtered stream has a filter for filtering output and a filter for filtering input made to a underlying stream
10+ * A filtered stream has a filter for filtering output and a filter for filtering input made to a underlying stream.
1211 *
1312 * @author Joel Wurtz <joel.wurtz@gmail.com>
1413 */
@@ -39,7 +38,7 @@ abstract class FilteredStream implements StreamInterface
3938 protected $ writeFilter ;
4039
4140 /**
42- * Internal buffer
41+ * Internal buffer.
4342 *
4443 * @var string
4544 */
@@ -52,9 +51,9 @@ abstract class FilteredStream implements StreamInterface
5251 */
5352 public function __construct (StreamInterface $ stream , $ readFilterOptions = null , $ writeFilterOptions = null )
5453 {
55- $ this ->readFilterCallback = Filter \fun ($ this ->getReadFilter (), $ readFilterOptions );
54+ $ this ->readFilterCallback = Filter \fun ($ this ->getReadFilter (), $ readFilterOptions );
5655 $ this ->writeFilterCallback = Filter \fun ($ this ->getWriteFilter (), $ writeFilterOptions );
57- $ this ->stream = $ stream ;
56+ $ this ->stream = $ stream ;
5857 }
5958
6059 /**
@@ -80,19 +79,19 @@ public function read($length)
8079 $ this ->buffer = '' ;
8180 $ this ->fill ();
8281
83- return $ read . $ this ->read ($ length - strlen ($ read ));
82+ return $ read. $ this ->read ($ length - strlen ($ read ));
8483 }
8584
8685 /**
8786 * {@inheritdoc}
8887 */
8988 public function eof ()
9089 {
91- return ( $ this ->stream ->eof () && $ this ->buffer === '' ) ;
90+ return $ this ->stream ->eof () && $ this ->buffer === '' ;
9291 }
9392
9493 /**
95- * Buffer is filled by reading underlying stream
94+ * Buffer is filled by reading underlying stream.
9695 *
9796 * Callback is reading once more even if the stream is ended.
9897 * This allow to get last data in the PHP buffer otherwise this
@@ -129,14 +128,14 @@ public function getContents()
129128 }
130129
131130 /**
132- * Return the read filter name
131+ * Return the read filter name.
133132 *
134133 * @return string
135134 */
136135 abstract public function getReadFilter ();
137136
138137 /**
139- * Return the write filter name
138+ * Return the write filter name.
140139 *
141140 * @return mixed
142141 */
0 commit comments