You are here

class LockrSettings in Lockr 7.3

Hierarchy

Expanded class hierarchy of LockrSettings

File

vendor/lockr/lockr/src/LockrSettings.php, line 4

Namespace

Lockr
View source
class LockrSettings implements SettingsInterface {

  /** @var string $certPath */
  private $certPath;

  /** @var string $host */
  private $host;

  /** @var string $certPassword */
  private $certPassword;

  /**
   * @param string|null $cert_path
   * @param string|null $host
   * @param string|null $cert_password
   */
  public function __construct($cert_path = null, $host = null, $cert_password = null) {
    $this->certPath = $cert_path;
    $this->host = $host;
    $this->certPassword = $cert_password;
  }

  /**
   * {@inheritdoc}
   */
  public function getHostname() {
    return $this->host ?: 'api.lockr.io';
  }

  /**
   * {@inheritdoc}
   */
  public function getOptions() {
    $opts = [];
    if ($this->certPath) {
      if ($this->certPassword) {
        $opts['cert'] = [
          $this->certPath,
          $this->certPassword,
        ];
      }
      else {
        $opts['cert'] = $this->certPath;
      }
    }
    return $opts;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
LockrSettings::$certPassword private property @var string $certPassword
LockrSettings::$certPath private property @var string $certPath
LockrSettings::$host private property @var string $host
LockrSettings::getHostname public function Gets the Lockr host to connect to. Overrides SettingsInterface::getHostname
LockrSettings::getOptions public function Gets the Guzzle client options to apply. Overrides SettingsInterface::getOptions 1
LockrSettings::__construct public function