target = $target; $this->type = $type; } public function getTarget(): string { return $this->target; } public function getHttpCode(): int { switch ($this->type) { case IRedirect::PERMANENT: return 301; case IRedirect::TEMPORARY: return 302; default: return 302; } } }