Skip to content

Commit 0bc7622

Browse files
author
abdulkadir polat
committed
Logger Removed
1 parent db912a2 commit 0bc7622

File tree

5 files changed

+7
-30
lines changed

5 files changed

+7
-30
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ Special thanks Elephant.IO teams.
1717

1818
Installation
1919
============
20-
We are suggesting you to use composer, with the following: `php composer.phar require polatdev/pocketio`
20+
We are suggesting you to use composer, with the following: `php composer.phar require polatdev/pocket.io`
2121

22-
Or basicly: `composer require polatdev/pocketio`
22+
Or basicly: `composer require polatdev/pocket.io`
2323

2424
For other ways, you can check the release page, or the git clone urls.
2525

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
],
2222
"require": {
2323
"php": ">=7.4",
24-
"psr/log": "3.0.0",
2524
"ext-openssl": "*",
2625
"ext-json": "*"
2726
},

src/Client.php

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
namespace PocketIO;
1010

11-
use Psr\Log\NullLogger;
12-
use Psr\Log\LoggerInterface;
1311
use PocketIO\Exception\SocketException;
1412

1513
/**
@@ -21,19 +19,14 @@ class Client
2119
/** @var EngineInterface */
2220
private EngineInterface $engine;
2321

24-
/** @var LoggerInterface */
25-
private $logger;
26-
2722
private bool $isConnected = false;
2823

2924
/**
3025
* @param EngineInterface $engine
31-
* @param LoggerInterface|null $logger
3226
*/
33-
public function __construct(EngineInterface $engine, LoggerInterface $logger = null)
27+
public function __construct(EngineInterface $engine)
3428
{
3529
$this->engine = $engine;
36-
$this->logger = $logger ?: new NullLogger;
3730
}
3831

3932
public function __destruct()
@@ -49,21 +42,13 @@ public function __destruct()
4942
* Connects to the websocket
5043
*
5144
* @return $this
45+
* @throws SocketException
5246
*/
5347
public function initialize(): Client
5448
{
55-
try {
56-
$this->logger->debug('Connecting to the websocket');
57-
$this->engine->connect();
58-
$this->logger->debug('Connected to the server');
59-
60-
$this->isConnected = true;
61-
} catch (SocketException $e) {
62-
$this->logger->error('Could not connect to the server', ['exception' => $e]);
63-
64-
throw $e;
65-
}
6649

50+
$this->engine->connect();
51+
$this->isConnected = true;
6752
return $this;
6853
}
6954

@@ -74,7 +59,6 @@ public function initialize(): Client
7459
*/
7560
public function read(): string
7661
{
77-
$this->logger->debug('Reading a new message from the socket');
7862
return $this->engine->read();
7963
}
8064

@@ -88,7 +72,6 @@ public function read(): string
8872
*/
8973
public function emit(string $event, array $args): Client
9074
{
91-
$this->logger->debug('Sending a new message', ['event' => $event, 'args' => $args]);
9275
$this->engine->emit($event, $args);
9376

9477
return $this;
@@ -102,7 +85,6 @@ public function emit(string $event, array $args): Client
10285
*/
10386
public function of($namespace): Client
10487
{
105-
$this->logger->debug('Setting the namespace', ['namespace' => $namespace]);
10688
$this->engine->of($namespace);
10789

10890
return $this;
@@ -115,7 +97,6 @@ public function of($namespace): Client
11597
*/
11698
public function close(): Client
11799
{
118-
$this->logger->debug('Closing the connection to the websocket');
119100
$this->engine->close();
120101

121102
$this->isConnected = false;

src/Engine/AbstractSocketIO.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use DomainException;
1212
use PocketIO\Engine\SocketIO\Session;
1313
use RuntimeException;
14-
use Psr\Log\LoggerInterface;
1514
use PocketIO\EngineInterface;
1615
use PocketIO\Payload\Decoder;
1716
use PocketIO\Exception\UnsupportedActionException;

src/Engine/SocketIO/SocketIO.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,9 @@
1111
use Exception;
1212
use InvalidArgumentException;
1313
use UnexpectedValueException;
14-
1514
use PocketIO\EngineInterface;
16-
use PocketIO\Payload\Encoder;
1715
use PocketIO\Engine\AbstractSocketIO;
18-
16+
use PocketIO\Payload\Encoder;
1917
use PocketIO\Exception\SocketException;
2018
use PocketIO\Exception\UnsupportedTransportException;
2119
use PocketIO\Exception\ServerConnectionFailureException;

0 commit comments

Comments
 (0)