Skip to content

Commit 0a0b2ed

Browse files
authored
Support psr/log:^3.0 (#94)
* Support psr/log:^3.0 * Update Logger to comply to the interface of psr/log:^3.0 * Use LoggerInterface for private logger in MqttClient
1 parent f2a52b8 commit 0a0b2ed

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
},
2929
"require": {
3030
"php": "^7.4|^8.0",
31-
"psr/log": "^1.1|^2.0",
31+
"psr/log": "^1.1|^2.0|^3.0",
3232
"myclabs/php-enum": "^1.7"
3333
},
3434
"require-dev": {

src/Logger.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(
4848
* @param array $context
4949
* @return void
5050
*/
51-
public function emergency($message, array $context = [])
51+
public function emergency($message, array $context = []): void
5252
{
5353
$this->log(LogLevel::EMERGENCY, $message, $context);
5454
}
@@ -63,7 +63,7 @@ public function emergency($message, array $context = [])
6363
* @param array $context
6464
* @return void
6565
*/
66-
public function alert($message, array $context = [])
66+
public function alert($message, array $context = []): void
6767
{
6868
$this->log(LogLevel::ALERT, $message, $context);
6969
}
@@ -77,7 +77,7 @@ public function alert($message, array $context = [])
7777
* @param array $context
7878
* @return void
7979
*/
80-
public function critical($message, array $context = [])
80+
public function critical($message, array $context = []): void
8181
{
8282
$this->log(LogLevel::CRITICAL, $message, $context);
8383
}
@@ -90,7 +90,7 @@ public function critical($message, array $context = [])
9090
* @param array $context
9191
* @return void
9292
*/
93-
public function error($message, array $context = [])
93+
public function error($message, array $context = []): void
9494
{
9595
$this->log(LogLevel::ERROR, $message, $context);
9696
}
@@ -105,7 +105,7 @@ public function error($message, array $context = [])
105105
* @param array $context
106106
* @return void
107107
*/
108-
public function warning($message, array $context = [])
108+
public function warning($message, array $context = []): void
109109
{
110110
$this->log(LogLevel::WARNING, $message, $context);
111111
}
@@ -117,7 +117,7 @@ public function warning($message, array $context = [])
117117
* @param array $context
118118
* @return void
119119
*/
120-
public function notice($message, array $context = [])
120+
public function notice($message, array $context = []): void
121121
{
122122
$this->log(LogLevel::NOTICE, $message, $context);
123123
}
@@ -131,7 +131,7 @@ public function notice($message, array $context = [])
131131
* @param array $context
132132
* @return void
133133
*/
134-
public function info($message, array $context = [])
134+
public function info($message, array $context = []): void
135135
{
136136
$this->log(LogLevel::INFO, $message, $context);
137137
}
@@ -143,7 +143,7 @@ public function info($message, array $context = [])
143143
* @param array $context
144144
* @return void
145145
*/
146-
public function debug($message, array $context = [])
146+
public function debug($message, array $context = []): void
147147
{
148148
$this->log(LogLevel::DEBUG, $message, $context);
149149
}

src/MqttClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class MqttClient implements ClientContract
4949
private ?float $lastPingAt = null;
5050
private MessageProcessor $messageProcessor;
5151
private Repository $repository;
52-
private Logger $logger;
52+
private LoggerInterface $logger;
5353
private bool $interrupted = false;
5454
private int $bytesReceived = 0;
5555
private int $bytesSent = 0;

0 commit comments

Comments
 (0)