Skip to content

Commit 7ec9ca7

Browse files
committed
Ensure logger assigned before initialising objects
If the logger isn't assigned in the SimpleClient's constructor before the object graph is initialised, dependencies will get a NullLogger rather than the LoggerInterface passed in.
1 parent 665a5a5 commit 7ec9ca7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/simple-client/SimpleClient.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ public function __construct($config, LoggerInterface $logger = null)
126126
];
127127
}
128128

129-
$this->build(['enqueue' => $config]);
130-
131129
$this->logger = $logger ?: new NullLogger();
130+
131+
$this->build(['enqueue' => $config]);
132132
}
133133

134134
/**

0 commit comments

Comments
 (0)