diff --git a/src/Client.php b/src/Client.php index d6a41a9..70c33fd 100644 --- a/src/Client.php +++ b/src/Client.php @@ -12,7 +12,7 @@ use \InvalidArgumentException; use RuntimeException; -class Client implements ConnectorInterface +final class Client implements ConnectorInterface { /** * diff --git a/src/Server.php b/src/Server.php index 2bc4723..cc41f1f 100644 --- a/src/Server.php +++ b/src/Server.php @@ -15,7 +15,7 @@ use \Exception; use React\Promise\Timer\TimeoutException; -class Server +final class Server { // the following error codes are only used for SOCKS5 only /** @internal */ @@ -35,7 +35,7 @@ class Server /** @internal */ const ERROR_ADDRESS_UNSUPPORTED = 0x08; - protected $loop; + private $loop; private $connector; @@ -104,6 +104,7 @@ public function unsetAuth() $this->auth = null; } + /** @internal */ public function onConnection(ConnectionInterface $connection) { $that = $this; @@ -118,7 +119,9 @@ public function onConnection(ConnectionInterface $connection) } /** - * gracefully shutdown connection by flushing all remaining data and closing stream + * [internal] gracefully shutdown connection by flushing all remaining data and closing stream + * + * @internal */ public function endConnection(ConnectionInterface $stream) { @@ -179,6 +182,7 @@ private function handleSocks(ConnectionInterface $stream) }); } + /** @internal */ public function handleSocks4(ConnectionInterface $stream, $protocolVersion, StreamReader $reader) { // suppliying hostnames is only allowed for SOCKS4a (or automatically detected version) @@ -235,6 +239,7 @@ public function handleSocks4(ConnectionInterface $stream, $protocolVersion, Stre }); } + /** @internal */ public function handleSocks5(ConnectionInterface $stream, $auth=null, StreamReader $reader) { $remote = $stream->getRemoteAddress(); @@ -344,6 +349,7 @@ public function handleSocks5(ConnectionInterface $stream, $auth=null, StreamRead }); } + /** @internal */ public function connectTarget(ConnectionInterface $stream, array $target) { $uri = $target[0]; diff --git a/src/StreamReader.php b/src/StreamReader.php index 6dbf51c..f01d252 100644 --- a/src/StreamReader.php +++ b/src/StreamReader.php @@ -9,7 +9,7 @@ /** * @internal */ -class StreamReader +final class StreamReader { const RET_DONE = true; const RET_INCOMPLETE = null;