mirror of
https://github.com/danog/byte-stream.git
synced 2024-11-30 04:19:23 +01:00
Make InMemoryStream, IteratorStream and methods of Message final
This commit is contained in:
parent
7616029740
commit
c33c2bec61
@ -8,7 +8,7 @@ use Amp\Success;
|
||||
/**
|
||||
* Input stream with a single already known data chunk.
|
||||
*/
|
||||
class InMemoryStream implements InputStream {
|
||||
final class InMemoryStream implements InputStream {
|
||||
private $contents;
|
||||
|
||||
/**
|
||||
|
@ -7,7 +7,7 @@ use Amp\Failure;
|
||||
use Amp\Iterator;
|
||||
use Amp\Promise;
|
||||
|
||||
class IteratorStream implements InputStream {
|
||||
final class IteratorStream implements InputStream {
|
||||
private $iterator;
|
||||
private $exception;
|
||||
|
||||
|
@ -84,7 +84,7 @@ class Message implements InputStream, Promise {
|
||||
return $this->buffer;
|
||||
}
|
||||
|
||||
public function read(): Promise {
|
||||
final public function read(): Promise {
|
||||
if ($this->pendingRead) {
|
||||
throw new PendingReadError;
|
||||
}
|
||||
@ -117,7 +117,7 @@ class Message implements InputStream, Promise {
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function onResolve(callable $onResolved) {
|
||||
final public function onResolve(callable $onResolved) {
|
||||
$this->buffering = true;
|
||||
|
||||
if ($this->coroutine === null) {
|
||||
@ -141,7 +141,7 @@ class Message implements InputStream, Promise {
|
||||
*
|
||||
* @return InputStream
|
||||
*/
|
||||
public function getInputStream(): InputStream {
|
||||
final public function getInputStream(): InputStream {
|
||||
return $this->source;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user