Skip to content

Commit

Permalink
[Provider] Support passing options to providers :)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Feb 11, 2018
1 parent 1ec0b81 commit ddb2b4a
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions AbstractBaseProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ abstract class AbstractBaseProvider
*/
protected $session;

/**
* @var array
*/
protected $options = [];

/**
* @param ClientInterface $httpClient
* @param SessionInterface $session
Expand All @@ -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;
}

/**
Expand Down

0 comments on commit ddb2b4a

Please sign in to comment.