From a60251541cc5f29f958ac0d0c4bd4c22e95f964e Mon Sep 17 00:00:00 2001 From: Di Date: Wed, 18 Dec 2024 11:58:57 +0100 Subject: [PATCH 1/2] Explicitly nullable types --- composer.json | 58 +++++++++++++++++++++++++++++------------------ src/Connector.php | 2 +- src/functions.php | 2 +- 3 files changed, 38 insertions(+), 24 deletions(-) diff --git a/composer.json b/composer.json index d7a09ec..73b69fb 100644 --- a/composer.json +++ b/composer.json @@ -1,25 +1,39 @@ { - "name": "ratchet/pawl" - , "description": "Asynchronous WebSocket client" - , "keywords": ["WebSocket", "client", "Ratchet", "async", "websocket client"] - , "license": "MIT" - , "autoload": { - "psr-4": { - "Ratchet\\Client\\": "src" - } - , "files": ["src/functions_include.php"] - } - , "require": { - "php": ">=5.4" - , "evenement/evenement": "^3.0 || ^2.0" - , "guzzlehttp/psr7": "^2.0 || ^1.7" - , "ratchet/rfc6455": "^0.3.1" - , "react/socket": "^1.9" - } - , "require-dev": { - "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8" - } - , "suggest": { - "reactivex/rxphp": "~2.0" + "name": "ratchet/pawl", + "description": "Asynchronous WebSocket client", + "keywords": [ + "WebSocket", + "client", + "Ratchet", + "async", + "websocket client" + ], + "license": "MIT", + "autoload": { + "psr-4": { + "Ratchet\\Client\\": "src" + }, + "files": [ + "src/functions_include.php" + ] + }, + "require": { + "php": "^7.1 || ^8.0", + "evenement/evenement": "^3.0 || ^2.0", + "guzzlehttp/psr7": "^2.0 || ^1.7", + "ratchet/rfc6455": "dev-master", + "react/socket": "^1.9" + }, + "require-dev": { + "phpunit/phpunit": "^9.3 || ^5.7 || ^4.8" + }, + "suggest": { + "reactivex/rxphp": "~2.0" + }, + "repositories": [ + { + "type": "git", + "url": "https://github.com/mechelon/RFC6455" } + ] } diff --git a/src/Connector.php b/src/Connector.php index 456a3d1..c7b0ac3 100644 --- a/src/Connector.php +++ b/src/Connector.php @@ -15,7 +15,7 @@ class Connector { protected $_connector; protected $_negotiator; - public function __construct(LoopInterface $loop = null, ConnectorInterface $connector = null) { + public function __construct(?LoopInterface $loop = null, ?ConnectorInterface $connector = null) { $this->_loop = $loop ?: Loop::get(); if (null === $connector) { diff --git a/src/functions.php b/src/functions.php index 373afe4..b060fd8 100644 --- a/src/functions.php +++ b/src/functions.php @@ -9,7 +9,7 @@ * @param LoopInterface|null $loop * @return \React\Promise\PromiseInterface<\Ratchet\Client\WebSocket> */ -function connect($url, array $subProtocols = [], $headers = [], LoopInterface $loop = null) { +function connect($url, array $subProtocols = [], $headers = [], ?LoopInterface $loop = null) { $connector = new Connector($loop); $connection = $connector($url, $subProtocols, $headers); From b61bca50ce743d8da0b35fc57906fe3eafc8cb0a Mon Sep 17 00:00:00 2001 From: Di Date: Thu, 19 Dec 2024 09:56:22 +0100 Subject: [PATCH 2/2] Changed fork organization --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 73b69fb..458054f 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "repositories": [ { "type": "git", - "url": "https://github.com/mechelon/RFC6455" + "url": "https://github.com/beyondcode/RFC6455" } ] }