From 49ecaa434e6be851c3bdef225358f53095956d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Tue, 2 May 2017 16:26:13 +0200 Subject: [PATCH] Mark all classes as final Classes should be used via composition rather than extension. This reduces our API footprint and avoids future BC breaks by avoiding exposing its internal assumptions. --- src/CompositeStream.php | 2 +- src/DuplexResourceStream.php | 2 +- src/ReadableResourceStream.php | 2 +- src/ThroughStream.php | 2 +- src/Util.php | 2 +- src/WritableResourceStream.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/CompositeStream.php b/src/CompositeStream.php index 47f057c..084385b 100644 --- a/src/CompositeStream.php +++ b/src/CompositeStream.php @@ -4,7 +4,7 @@ use Evenement\EventEmitter; -class CompositeStream extends EventEmitter implements DuplexStreamInterface +final class CompositeStream extends EventEmitter implements DuplexStreamInterface { protected $readable; protected $writable; diff --git a/src/DuplexResourceStream.php b/src/DuplexResourceStream.php index 113c9aa..7869eda 100644 --- a/src/DuplexResourceStream.php +++ b/src/DuplexResourceStream.php @@ -6,7 +6,7 @@ use React\EventLoop\LoopInterface; use InvalidArgumentException; -class DuplexResourceStream extends EventEmitter implements DuplexStreamInterface +final class DuplexResourceStream extends EventEmitter implements DuplexStreamInterface { private $stream; private $loop; diff --git a/src/ReadableResourceStream.php b/src/ReadableResourceStream.php index 3edf80e..6a9cd65 100644 --- a/src/ReadableResourceStream.php +++ b/src/ReadableResourceStream.php @@ -6,7 +6,7 @@ use React\EventLoop\LoopInterface; use InvalidArgumentException; -class ReadableResourceStream extends EventEmitter implements ReadableStreamInterface +final class ReadableResourceStream extends EventEmitter implements ReadableStreamInterface { /** * @var resource diff --git a/src/ThroughStream.php b/src/ThroughStream.php index 9a22b2d..da2fbb0 100644 --- a/src/ThroughStream.php +++ b/src/ThroughStream.php @@ -73,7 +73,7 @@ * @see DuplexStreamInterface::close() * @see WritableStreamInterface::pipe() */ -class ThroughStream extends EventEmitter implements DuplexStreamInterface +final class ThroughStream extends EventEmitter implements DuplexStreamInterface { private $readable = true; private $writable = true; diff --git a/src/Util.php b/src/Util.php index d59728e..14ddcfc 100644 --- a/src/Util.php +++ b/src/Util.php @@ -2,7 +2,7 @@ namespace React\Stream; -class Util +final class Util { /** * Pipes all the data from the given $source into the $dest diff --git a/src/WritableResourceStream.php b/src/WritableResourceStream.php index 47883e2..a52bc2e 100644 --- a/src/WritableResourceStream.php +++ b/src/WritableResourceStream.php @@ -5,7 +5,7 @@ use Evenement\EventEmitter; use React\EventLoop\LoopInterface; -class WritableResourceStream extends EventEmitter implements WritableStreamInterface +final class WritableResourceStream extends EventEmitter implements WritableStreamInterface { private $stream; private $loop;