Skip to content

Commit d20a065

Browse files
authored
Merge pull request #75 from WarriorXK/hotfix/4.0.1
Hotfix/4.0.1
2 parents 7a3c6dd + 3d0c4f8 commit d20a065

File tree

9 files changed

+18
-18
lines changed

9 files changed

+18
-18
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
4.0.0
1+
4.0.1

src/PHPWebSockets/AConnection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ public function isWriteBufferEmpty() : bool {
262262
*
263263
* @return bool
264264
*/
265-
public function writeUntilEmpty(float $totalTimeout = NULL, float $lastUpdateTimeout = NULL) : bool {
265+
public function writeUntilEmpty(?float $totalTimeout = NULL, ?float $lastUpdateTimeout = NULL) : bool {
266266

267267
$start = microtime(TRUE);
268268
$lastTimeWritten = $start;
@@ -819,7 +819,7 @@ public function write(string $data, int $opcode = \PHPWebSockets::OPCODE_FRAME_T
819819
*
820820
* @return bool
821821
*/
822-
public function waitUntilDisconnect(float $timeout = NULL) : bool {
822+
public function waitUntilDisconnect(?float $timeout = NULL) : bool {
823823

824824
$start = microtime(TRUE);
825825
do {
@@ -888,7 +888,7 @@ protected function _checkRSVBits(array $headers) : bool {
888888
*
889889
* @return void
890890
*/
891-
public function setNewMessageStreamCallback(callable $callable = NULL) : void {
891+
public function setNewMessageStreamCallback(?callable $callable = NULL) : void {
892892
$this->_newMessageStreamCallback = $callable;
893893
}
894894

src/PHPWebSockets/AUpdate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ abstract class AUpdate {
5656
*/
5757
protected $_code = 0;
5858

59-
public function __construct(int $code, AConnection $sourceConnection = NULL) {
59+
public function __construct(int $code, ?AConnection $sourceConnection = NULL) {
6060

6161
$this->_sourceConnection = $sourceConnection;
6262
$this->_code = $code;

src/PHPWebSockets/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ class Client extends AConnection {
9999
*/
100100
protected $_path = NULL;
101101

102-
public function __construct(LoggerInterface $logger = NULL) {
102+
public function __construct(?LoggerInterface $logger = NULL) {
103103

104104
if ($logger) {
105105
$this->setLogger($logger);

src/PHPWebSockets/Framer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public static function GetFrameHeaders(string $frame) : ?array {
128128
*
129129
* @return string|bool|null
130130
*/
131-
public static function GetFramePayload(string $frame, array $headers = NULL) {
131+
public static function GetFramePayload(string $frame, ?array $headers = NULL) {
132132

133133
$headers = ($headers ?? self::GetFrameHeaders($frame));
134134
if ($headers === NULL) {

src/PHPWebSockets/Server.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ class Server implements LoggerAwareInterface, ITaggable {
149149
*
150150
* @return void
151151
*/
152-
public function __construct(string $address = NULL, array $streamContext = [], bool $useCrypto = FALSE, LoggerInterface $logger = NULL) {
152+
public function __construct(?string $address = NULL, array $streamContext = [], bool $useCrypto = FALSE, ?LoggerInterface $logger = NULL) {
153153

154154
if ($logger !== NULL) {
155155
$this->setLogger($logger);

src/PHPWebSockets/Server/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ protected function _parseHeaders() : void {
317317
*
318318
* @return void
319319
*/
320-
public function accept(string $protocol = NULL, array $additionalHeaders = []) : void {
320+
public function accept(?string $protocol = NULL, array $additionalHeaders = []) : void {
321321

322322
if ($this->isAccepted()) {
323323
throw new \LogicException('Connection has already been accepted!');

src/PHPWebSockets/Update/Read.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Read extends AUpdate {
6767
*/
6868
protected $_stream = NULL;
6969

70-
public function __construct(int $code, AConnection $sourceConnection = NULL, int $opcode = NULL, string $message = NULL, $stream = NULL) {
70+
public function __construct(int $code, ?AConnection $sourceConnection = NULL, ?int $opcode = NULL, ?string $message = NULL, $stream = NULL) {
7171

7272
if ($stream !== NULL && !is_resource($stream)) {
7373
throw new \InvalidArgumentException('The $stream argument has to be NULL or a resource!');

src/PHPWebSockets/UpdatesWrapper.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ public function removeStreamContainer(IStreamContainer $container) : bool {
129129
*
130130
* @return void
131131
*/
132-
public function run(float $timeout = NULL, callable $runLoop = NULL) : void {
132+
public function run(?float $timeout = NULL, ?callable $runLoop = NULL) : void {
133133

134134
$this->_shouldRun = TRUE;
135135
while ($this->_shouldRun) {
@@ -288,7 +288,7 @@ public function update(?float $timeout, array $tempStreams = []) : void {
288288
*
289289
* @return void
290290
*/
291-
public function setClientConnectedHandler(callable $callable = NULL) : void {
291+
public function setClientConnectedHandler(?callable $callable = NULL) : void {
292292
$this->_clientConnectedHandler = $callable;
293293
}
294294

@@ -297,7 +297,7 @@ public function setClientConnectedHandler(callable $callable = NULL) : void {
297297
*
298298
* @return void
299299
*/
300-
public function setNewConnectionHandler(callable $callable = NULL) : void {
300+
public function setNewConnectionHandler(?callable $callable = NULL) : void {
301301
$this->_newConnectionHandler = $callable;
302302
}
303303

@@ -306,7 +306,7 @@ public function setNewConnectionHandler(callable $callable = NULL) : void {
306306
*
307307
* @return void
308308
*/
309-
public function setLastContactHandler(callable $callable = NULL) : void {
309+
public function setLastContactHandler(?callable $callable = NULL) : void {
310310
$this->_lastContactHandler = $callable;
311311
}
312312

@@ -315,7 +315,7 @@ public function setLastContactHandler(callable $callable = NULL) : void {
315315
*
316316
* @return void
317317
*/
318-
public function setMessageHandler(callable $callable = NULL) : void {
318+
public function setMessageHandler(?callable $callable = NULL) : void {
319319
$this->_newMessageHandler = $callable;
320320
}
321321

@@ -324,7 +324,7 @@ public function setMessageHandler(callable $callable = NULL) : void {
324324
*
325325
* @return void
326326
*/
327-
public function setDisconnectHandler(callable $callable = NULL) : void {
327+
public function setDisconnectHandler(?callable $callable = NULL) : void {
328328
$this->_disconnectHandler = $callable;
329329
}
330330

@@ -333,7 +333,7 @@ public function setDisconnectHandler(callable $callable = NULL) : void {
333333
*
334334
* @return void
335335
*/
336-
public function setErrorHandler(callable $callable = NULL) : void {
336+
public function setErrorHandler(?callable $callable = NULL) : void {
337337
$this->_errorHandler = $callable;
338338
}
339339

@@ -368,7 +368,7 @@ private function _triggerLastContactHandler(AConnection $connection) {
368368
}
369369
}
370370

371-
private function _triggerDisconnectHandler(AConnection $connection, bool $wasClean, string $data = NULL) : void {
371+
private function _triggerDisconnectHandler(AConnection $connection, bool $wasClean, ?string $data = NULL) : void {
372372

373373
$reason = '';
374374
$code = 0;

0 commit comments

Comments
 (0)