|
19 | 19 | use chillerlan\Settings\SettingsContainerInterface;
|
20 | 20 | use Psr\Http\Client\ClientInterface;
|
21 | 21 | use Psr\Http\Message\{RequestFactoryInterface, ResponseInterface, StreamFactoryInterface, StreamInterface, UriFactoryInterface};
|
22 |
| -use Psr\Log\{LoggerAwareInterface, LoggerAwareTrait, NullLogger}; |
| 22 | +use Psr\Log\{LoggerAwareInterface, LoggerAwareTrait, LoggerInterface, NullLogger}; |
23 | 23 | use ReflectionClass;
|
24 | 24 |
|
25 | 25 | /**
|
@@ -118,15 +118,16 @@ abstract class OAuthProvider implements OAuthInterface, ApiClientInterface, Logg
|
118 | 118 | * @param \Psr\Http\Client\ClientInterface $http
|
119 | 119 | * @param \chillerlan\OAuth\Storage\OAuthStorageInterface $storage
|
120 | 120 | * @param \chillerlan\Settings\SettingsContainerInterface $options
|
| 121 | + * @param \Psr\Log\LoggerInterface|null $logger |
121 | 122 | *
|
122 | 123 | * @throws \chillerlan\HTTP\MagicAPI\ApiClientException
|
123 | 124 | */
|
124 |
| - public function __construct(ClientInterface $http, OAuthStorageInterface $storage, SettingsContainerInterface $options){ |
| 125 | + public function __construct(ClientInterface $http, OAuthStorageInterface $storage, SettingsContainerInterface $options, LoggerInterface $logger = null){ |
125 | 126 | $this->http = $http;
|
126 | 127 | $this->storage = $storage;
|
127 | 128 | $this->options = $options;
|
| 129 | + $this->logger = $logger ?? new NullLogger; |
128 | 130 |
|
129 |
| - $this->logger = new NullLogger; |
130 | 131 | $this->requestFactory = new RequestFactory;
|
131 | 132 | $this->streamFactory = new StreamFactory;
|
132 | 133 | $this->uriFactory = new UriFactory;
|
|
0 commit comments