Skip to content
Permalink
Browse files

[Provider] Support passing options to providers :)

  • Loading branch information...
ovr committed Feb 11, 2018
1 parent d08c69f commit d34b4885d0e637ff4bb3f24006a91ec2fb584753
Showing with 23 additions and 0 deletions.
  1. +23 −0 src/Provider/AbstractBaseProvider.php
@@ -41,6 +41,11 @@ abstract class AbstractBaseProvider
*/
protected $session;
/**
* @var array
*/
protected $options = [];
/**
* @param ClientInterface $httpClient
* @param SessionInterface $session
@@ -63,6 +68,24 @@ public function __construct(ClientInterface $httpClient, SessionInterface $sessi
if (isset($parameters['redirectUri'])) {
$this->redirectUri = $parameters['redirectUri'];
}
if (isset($parameters['options'])) {
$this->options = $parameters['options'];
}
}
/**
* @param string $key
* @param bool $default
* @return bool
*/
public function getBoolOption($key, $default)
{
if (array_key_exists($key, $this->options)) {
return (bool) $this->options[$key];
}
return $default;
}
/**

0 comments on commit d34b488

Please sign in to comment.
You can’t perform that action at this time.