Skip to content

Commit

Permalink
Don't set logger if it doesn't exist.
Browse files Browse the repository at this point in the history
Fixes #162
  • Loading branch information
mikebronner committed Oct 15, 2019
1 parent d9cccd3 commit 67f027b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ProviderAndDumperAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ protected function getProvidersFromConfiguration(Collection $providers) : array
if ($provider === "Geocoder\Provider\Chain\Chain") {
$chainProvider = $reflection->newInstance($arguments);

if (in_array(LoggerAwareTrait::class, class_uses($chainProvider))
if (class_exists(Logger::class)
&& in_array(LoggerAwareTrait::class, class_uses($chainProvider))
&& app(Logger::class) !== null
) {
$chainProvider->setLogger(app(Logger::class));
Expand Down

0 comments on commit 67f027b

Please sign in to comment.