2016-08-07 15:44:33 +03:00
|
|
|
<?php
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2016-08-07 15:44:33 +03:00
|
|
|
namespace Shlinkio\Shlink\Core\Options;
|
|
|
|
|
|
|
|
use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
|
|
|
|
use Zend\Stdlib\AbstractOptions;
|
2019-02-27 00:56:43 +03:00
|
|
|
|
2018-10-28 10:34:02 +03:00
|
|
|
use function sprintf;
|
2016-08-07 15:44:33 +03:00
|
|
|
|
|
|
|
class AppOptions extends AbstractOptions
|
|
|
|
{
|
|
|
|
use StringUtilsTrait;
|
|
|
|
|
2018-11-20 21:30:27 +03:00
|
|
|
/** @var string */
|
2018-11-20 21:37:22 +03:00
|
|
|
private $name = '';
|
2018-11-20 21:30:27 +03:00
|
|
|
/** @var string */
|
2018-11-20 21:37:22 +03:00
|
|
|
private $version = '1.0';
|
2018-12-06 23:05:11 +03:00
|
|
|
/**
|
|
|
|
* @var string
|
|
|
|
* @deprecated
|
|
|
|
*/
|
2018-11-20 21:37:22 +03:00
|
|
|
private $secretKey = '';
|
2018-11-20 21:30:27 +03:00
|
|
|
/** @var string|null */
|
2018-11-20 21:37:22 +03:00
|
|
|
private $disableTrackParam;
|
2016-08-07 15:44:33 +03:00
|
|
|
|
2018-12-06 23:05:11 +03:00
|
|
|
public function getName(): string
|
2016-08-07 15:44:33 +03:00
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
|
2018-12-06 23:05:11 +03:00
|
|
|
protected function setName(string $name): self
|
2016-08-07 15:44:33 +03:00
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-12-06 23:05:11 +03:00
|
|
|
public function getVersion(): string
|
2016-08-07 15:44:33 +03:00
|
|
|
{
|
|
|
|
return $this->version;
|
|
|
|
}
|
|
|
|
|
2018-12-06 23:05:11 +03:00
|
|
|
protected function setVersion(string $version): self
|
2016-08-07 15:44:33 +03:00
|
|
|
{
|
|
|
|
$this->version = $version;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-12-06 23:05:11 +03:00
|
|
|
* @deprecated
|
2016-08-07 15:44:33 +03:00
|
|
|
*/
|
2018-12-06 23:05:11 +03:00
|
|
|
public function getSecretKey(): string
|
2016-08-07 15:44:33 +03:00
|
|
|
{
|
|
|
|
return $this->secretKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-12-06 23:05:11 +03:00
|
|
|
* @deprecated
|
2016-08-07 15:44:33 +03:00
|
|
|
*/
|
2018-12-06 23:05:11 +03:00
|
|
|
protected function setSecretKey(string $secretKey): self
|
2016-08-07 15:44:33 +03:00
|
|
|
{
|
|
|
|
$this->secretKey = $secretKey;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-01-14 11:13:49 +03:00
|
|
|
/**
|
|
|
|
* @return string|null
|
|
|
|
*/
|
2018-12-06 23:05:11 +03:00
|
|
|
public function getDisableTrackParam(): ?string
|
2018-01-14 11:13:49 +03:00
|
|
|
{
|
|
|
|
return $this->disableTrackParam;
|
|
|
|
}
|
|
|
|
|
2018-12-06 23:05:11 +03:00
|
|
|
protected function setDisableTrackParam(?string $disableTrackParam): self
|
2018-01-14 11:13:49 +03:00
|
|
|
{
|
|
|
|
$this->disableTrackParam = $disableTrackParam;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
2018-12-06 23:05:11 +03:00
|
|
|
public function __toString(): string
|
2016-08-07 15:44:33 +03:00
|
|
|
{
|
|
|
|
return sprintf('%s:v%s', $this->name, $this->version);
|
|
|
|
}
|
|
|
|
}
|