Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/Esia/OpenId.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Log\LoggerAwareTrait;
use Psr\Log\LoggerInterface;
use Psr\Log\NullLogger;
use RuntimeException;

Expand Down Expand Up @@ -48,12 +49,16 @@ class OpenId
*/
private $config;

public function __construct(Config $config, ClientInterface $client = null)
{
public function __construct(
Config $config,
ClientInterface $client = null,
SignerInterface $signer = null,
LoggerInterface $logger = null
) {
$this->config = $config;
$this->client = $client ?? new GuzzleHttpClient(new Client());
$this->logger = new NullLogger();
$this->signer = new SignerPKCS7(
$this->logger = $logger ?? new NullLogger();
$this->signer = $signer ?? new SignerPKCS7(
$config->getCertPath(),
$config->getPrivateKeyPath(),
$config->getPrivateKeyPassword(),
Expand Down