Skip to content

Commit

Permalink
fix Factory::create()
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Xie authored and Dave Xie committed Oct 23, 2024
1 parent 3901164 commit e55cfe9
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ try {
use KuCoin\SDK\Auth;
use KuCoin\SDK\PrivateApi\WebSocketFeed;
use Ratchet\Client\WebSocket;
use React\EventLoop\Factory;
use React\EventLoop\Loop;
use React\EventLoop\LoopInterface;

$auth = null;
Expand All @@ -110,7 +110,7 @@ $auth = null;
$api = new WebSocketFeed($auth);

// Use a custom event loop instance if you like
//$loop = Factory::create();
//$loop = Loop::get();
//$loop->addPeriodicTimer(1, function () {
// var_dump(date('Y-m-d H:i:s'));
//});
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"monolog/monolog": "~1.0|~2.0|~3.0"
},
"require-dev": {
"phpunit/phpunit": "^5.7"
"phpunit/phpunit": ">=5.7"
},
"autoload": {
"psr-4": {
Expand Down
4 changes: 2 additions & 2 deletions examples/WebSocketFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use KuCoin\SDK\KuCoinApi;
use KuCoin\SDK\PrivateApi\WebSocketFeed;
use Ratchet\Client\WebSocket;
use React\EventLoop\Factory;
use React\EventLoop\Loop;
use React\EventLoop\LoopInterface;

// Set the base uri, default "https://api.kucoin.com" for production environment.
Expand All @@ -17,7 +17,7 @@
$api = new WebSocketFeed($auth);

// Use a custom event loop instance if you like
//$loop = Factory::create();
//$loop = Loop::get();
//$loop->addPeriodicTimer(1, function () {
// var_dump(date('Y-m-d H:i:s'));
//});
Expand Down
6 changes: 3 additions & 3 deletions src/PrivateApi/WebSocketFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Ratchet\Client\Connector as RatchetConnector;
use Ratchet\Client\WebSocket;
use Ratchet\RFC6455\Messaging\MessageInterface;
use React\EventLoop\Factory;
use React\EventLoop\Loop;
use React\EventLoop\LoopInterface;
use React\Socket\Connector as SocketConnector;

Expand All @@ -24,13 +24,13 @@ class WebSocketFeed extends KuCoinApi
protected $loop;

/**
* Get the event loop instance, default return Factory::create()
* Get the event loop instance, default return Loop::get()
* @return LoopInterface
*/
public function getLoop()
{
if ($this->loop === null) {
$this->loop = Factory::create();
$this->loop = Loop::get();
}
return $this->loop;
}
Expand Down

0 comments on commit e55cfe9

Please sign in to comment.