NotFoundRedirectOptions.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. declare(strict_types=1);
  3. namespace Shlinkio\Shlink\Core\Options;
  4. use Laminas\Stdlib\AbstractOptions;
  5. class NotFoundRedirectOptions extends AbstractOptions
  6. {
  7. private ?string $invalidShortUrl = null;
  8. private ?string $regular404 = null;
  9. private ?string $baseUrl = null;
  10. public function getInvalidShortUrlRedirect(): ?string
  11. {
  12. return $this->invalidShortUrl;
  13. }
  14. public function hasInvalidShortUrlRedirect(): bool
  15. {
  16. return $this->invalidShortUrl !== null;
  17. }
  18. protected function setInvalidShortUrl(?string $invalidShortUrl): self
  19. {
  20. $this->invalidShortUrl = $invalidShortUrl;
  21. return $this;
  22. }
  23. public function getRegular404Redirect(): ?string
  24. {
  25. return $this->regular404;
  26. }
  27. public function hasRegular404Redirect(): bool
  28. {
  29. return $this->regular404 !== null;
  30. }
  31. protected function setRegular404(?string $regular404): self
  32. {
  33. $this->regular404 = $regular404;
  34. return $this;
  35. }
  36. public function getBaseUrlRedirect(): ?string
  37. {
  38. return $this->baseUrl;
  39. }
  40. public function hasBaseUrlRedirect(): bool
  41. {
  42. return $this->baseUrl !== null;
  43. }
  44. protected function setBaseUrl(?string $baseUrl): self
  45. {
  46. $this->baseUrl = $baseUrl;
  47. return $this;
  48. }
  49. }