AppOptions.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Core\Options;
  4. use Laminas\Stdlib\AbstractOptions;
  5. use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
  6. use function sprintf;
  7. class AppOptions extends AbstractOptions
  8. {
  9. use StringUtilsTrait;
  10. private string $name = '';
  11. private string $version = '1.0';
  12. private ?string $disableTrackParam = null;
  13. public function getName(): string
  14. {
  15. return $this->name;
  16. }
  17. protected function setName(string $name): self
  18. {
  19. $this->name = $name;
  20. return $this;
  21. }
  22. public function getVersion(): string
  23. {
  24. return $this->version;
  25. }
  26. protected function setVersion(string $version): self
  27. {
  28. $this->version = $version;
  29. return $this;
  30. }
  31. /**
  32. */
  33. public function getDisableTrackParam(): ?string
  34. {
  35. return $this->disableTrackParam;
  36. }
  37. protected function setDisableTrackParam(?string $disableTrackParam): self
  38. {
  39. $this->disableTrackParam = $disableTrackParam;
  40. return $this;
  41. }
  42. public function __toString(): string
  43. {
  44. return sprintf('%s:v%s', $this->name, $this->version);
  45. }
  46. }