for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace TBolier\RethinkQL\Connection;
class Options implements OptionsInterface
{
/**
* @var string
*/
private $hostname;
* @var int
private $port;
private $dbname;
private $user;
private $password;
* @var float
private $timeout;
private $timeoutStream;
* @var bool
private $ssl;
* @param array $options
public function __construct($options = [])
$this->hostname = $options['hostname'] ?? 'localhost';
$this->port = $options['port'] ?? 28015;
$this->dbname = $options['dbname'] ?? '';
$this->user = $options['user'] ?? '';
$this->password = $options['password'] ?? '';
$this->timeout = $options['timeout'] ?? 1.0;
$this->timeoutStream = $options['timeout_stream'] ?? 3;
$this->ssl = $options['ssl'] ?? false;
}
* @return string
public function getHostname(): string
return $this->hostname;
* @return int
public function getPort(): int
return $this->port;
public function getDbName(): string
return $this->dbname;
public function getUser(): string
return $this->user;
public function getPassword(): string
return $this->password;
* @return float
public function getTimeout(): float
return $this->timeout;
public function getTimeoutStream(): int
return $this->timeoutStream;
* @return bool
public function isSsl(): bool
return $this->ssl;
public function hasDefaultDatabase(): bool
return !empty($this->dbname);