for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Votifier PHP Client
*
* @package VotifierClient
* @author Manuele Vaccari <[email protected]>
* @copyright Copyright (c) 2017-2020 Manuele Vaccari <[email protected]>
* @license https://github.com/D3strukt0r/votifier-client-php/blob/master/LICENSE.txt GNU General Public License v3.0
* @link https://github.com/D3strukt0r/votifier-client-php
*/
namespace D3strukt0r\VotifierClient\ServerType;
abstract class GenericServerType implements ServerTypeInterface
{
* @var string the domain or ip to connect to Votifier
private $host;
* @var int the port which votifier uses on the server
private $port = 8192;
* @var string The public.key which is generated by the plugin.
private $publicKey;
* {@inheritdoc}
public function getHost(): string
return $this->host;
}
public function setHost(string $host): self
$this->host = $host;
return $this;
public function getPort(): int
return $this->port;
public function setPort(int $port)
$this->port = $port;
public function getPublicKey(): string
return $this->publicKey;
public function setPublicKey(string $publicKey): self
$publicKey = wordwrap($publicKey, 65, "\n", true);
$publicKey = <<<EOF
-----BEGIN PUBLIC KEY-----
{$publicKey}
-----END PUBLIC KEY-----
EOF;
$this->publicKey = $publicKey;