diff --git a/src/Interfaces/Controller/IController.php b/src/Interfaces/Controller/IController.php deleted file mode 100644 index 07caeeb..0000000 --- a/src/Interfaces/Controller/IController.php +++ /dev/null @@ -1,8 +0,0 @@ -target = $target; + $this->type = $type; + } + + public function getUrl(): string + { + if (is_array($this->target)) { + $link = $this->target[0]->generateLink($this->target[1]); + } else { + $link = $this->target; + } + + return $link; + } + + public function getHttpCode(): int + { + switch ($this->type) { + case IRedirect::PERMANENT: + return 301; + + case IRedirect::TEMPORARY: + return 302; + + default: + return 302; + } + } +}