pfs = \extension_loaded('gmp'); } public function mergeArray(array $settings): void { foreach (self::toCamel([ 'default_temp_auth_key_expires_in', 'rsa_keys', ]) as $object => $array) { if (isset($settings['authorization'][$array])) { $this->{$object}($settings['authorization'][$array]); } } if (isset($settings['connection_settings']['all']['pfs'])) { $this->setPfs($settings['connection_settings']['all']['pfs']); } } /** * Get MTProto public keys array. * * @return array */ public function getRsaKeys(): array { return $this->rsaKeys; } /** * Set MTProto public keys array. * * @param array $rsaKeys MTProto public keys array. * * @return self */ public function setRsaKeys(array $rsaKeys): self { $this->rsaKeys = $rsaKeys; return $this; } /** * Get validity period of the binding of temporary and permanent keys. * * @return int */ public function getDefaultTempAuthKeyExpiresIn(): int { return $this->defaultTempAuthKeyExpiresIn; } /** * Set validity period of the binding of temporary and permanent keys. * * @param int $defaultTempAuthKeyExpiresIn Validity period of the binding of temporary and permanent keys. * * @return self */ public function setDefaultTempAuthKeyExpiresIn(int $defaultTempAuthKeyExpiresIn): self { $this->defaultTempAuthKeyExpiresIn = $defaultTempAuthKeyExpiresIn; return $this; } /** * Get whether to use PFS. * * @return bool */ public function getPfs(): bool { return $this->pfs; } /** * Set whether to use PFS. * * @param bool $pfs Whether to use PFS * * @return self */ public function setPfs(bool $pfs): self { $this->pfs = $pfs; return $this; } /** * Get max tries for generating auth key. * * @return int */ public function getMaxAuthTries(): int { return $this->maxAuthTries; } /** * Set max tries for generating auth key. * * @param int $maxAuthTries Max tries for generating auth key * * @return self */ public function setMaxAuthTries(int $maxAuthTries): self { $this->maxAuthTries = $maxAuthTries; return $this; } }