Skip to content

Commit 6cb99ff

Browse files
committed
Remove logger from parameters
1 parent 056f301 commit 6cb99ff

File tree

3 files changed

+4
-10
lines changed

3 files changed

+4
-10
lines changed

src/Internal/ErrorHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ private function __construct()
3636
{
3737
}
3838

39-
public static function register(LoggerInterface &$logger): void
39+
public static function register(LoggerInterface $logger): void
4040
{
4141
if (self::$logger !== null) {
4242
throw new \LogicException(\sprintf('%s(): Already registered', __METHOD__));
4343
}
4444

45-
self::$logger = &$logger;
45+
self::$logger = $logger;
4646
\set_error_handler(self::handleError(...));
4747
\set_exception_handler(self::handleException(...));
4848
}
@@ -53,9 +53,9 @@ public static function unregister(): void
5353
return;
5454
}
5555

56-
self::$logger = null;
5756
\restore_error_handler();
5857
\restore_exception_handler();
58+
self::$logger = null;
5959
}
6060

6161
/**

src/MasterProcess.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ final class MasterProcess implements MessageHandler, MessageBus, Container
5555
private Supervisor $supervisor;
5656
private Scheduler $scheduler;
5757
private Container $container;
58+
private LoggerInterface $logger;
5859

5960
/**
6061
* @var array<class-string<Plugin>, Plugin>
@@ -64,7 +65,6 @@ final class MasterProcess implements MessageHandler, MessageBus, Container
6465
public function __construct(
6566
string|null $pidFile,
6667
int $stopTimeout,
67-
private LoggerInterface|null $logger,
6868
) {
6969
if (!\in_array(PHP_SAPI, ['cli', 'phpdbg', 'micro'], true)) {
7070
throw new \RuntimeException('Works in command line mode only');

src/Server.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,10 @@ public function __construct(
2929
* Timeout in seconds that master process will be waiting before force kill child processes after sending stop command.
3030
*/
3131
int $stopTimeout = 15,
32-
33-
/**
34-
* PSR-3 Logger implementation
35-
*/
36-
LoggerInterface|null $logger = null,
3732
) {
3833
$this->masterProcess = new MasterProcess(
3934
pidFile: $pidFile,
4035
stopTimeout: $stopTimeout,
41-
logger: $logger,
4236
);
4337

4438
$this->app = new App();

0 commit comments

Comments
 (0)