Skip to content

Commit 7a0fb0f

Browse files
committed
code errors
1 parent 2006cb1 commit 7a0fb0f

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

source/includes/connect/client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
$uri = 'mongodb://localhost:27017';
44
$uriOptions = ['serverSelectionTimeoutMS' => 10000];
55

6-
$client = new MongoDB\Client($uri, $uriOptions);
6+
$client = new MongoDB\Client($uri, $uriOptions);

source/includes/monitoring-logging/logging.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
require 'vendor/autoload.php';
44

55
// start-monolog-logger
6-
use Monolog\Logger;
76
use Monolog\Handler\StreamHandler;
7+
use Monolog\Logger;
88

99
$logger = new Logger('mongodb-logger');
1010
$logger->pushHandler(new StreamHandler(__DIR__ . '/mongodb.log', Logger::DEBUG));
@@ -14,15 +14,12 @@
1414

1515
// start-custom-logger
1616
use Psr\Log\AbstractLogger;
17-
use Psr\Log\LoggerInterface;
18-
use Psr\Log\LogLevel;
19-
use MongoDB\PsrLogAdapter;
2017

2118
class MyLogger extends AbstractLogger
2219
{
2320
public array $logs = [];
2421

25-
public function log($level, $message, array $context = []): void
22+
public function log(string $level, string|\Stringable $message, array $context = []): void
2623
{
2724
$this->logs[] = [$level, $message, $context['domain']];
2825
}

source/includes/monitoring-logging/monitor.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
// start-command-subscriber
66
class MyCommandSubscriber implements MongoDB\Driver\Monitoring\CommandSubscriber
77
{
8-
public function __construct(private $stream) {}
8+
/** @param resource $stream */
9+
public function __construct(private $stream)
10+
{}
911

1012
public function commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void
1113
{

0 commit comments

Comments
 (0)