shlink/module/Core/src/Options/AppOptions.php

85 lines
1.6 KiB
PHP
Raw Normal View History

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;
use function sprintf;
2016-08-07 15:44:33 +03:00
class AppOptions extends AbstractOptions
{
use StringUtilsTrait;
/** @var string */
private $name = '';
/** @var string */
private $version = '1.0';
2018-12-06 23:05:11 +03:00
/**
* @var string
* @deprecated
*/
private $secretKey = '';
/** @var string|null */
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;
}
/**
* @return string|null
*/
2018-12-06 23:05:11 +03:00
public function getDisableTrackParam(): ?string
{
return $this->disableTrackParam;
}
2018-12-06 23:05:11 +03:00
protected function setDisableTrackParam(?string $disableTrackParam): self
{
$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);
}
}