From bd02333bfa0e1b3cb4ac72e5f6ae40833f2839a1 Mon Sep 17 00:00:00 2001 From: kenjis Date: Fri, 24 Feb 2023 09:09:57 +0900 Subject: [PATCH] refactor: remove unneeded override The parent method is fixed. --- system/HTTP/SiteURI.php | 30 ------------------------------ 1 file changed, 30 deletions(-) diff --git a/system/HTTP/SiteURI.php b/system/HTTP/SiteURI.php index 9d4ccef074d6..fc1071647462 100644 --- a/system/HTTP/SiteURI.php +++ b/system/HTTP/SiteURI.php @@ -252,36 +252,6 @@ public function getRoutePath(): string return $this->routePath; } - /** - * Returns the value of a specific segment of the URI path. - * Allows to get only existing segments or the next one. - * - * @param int $number Segment number starting at 1 - * @param string $default Default value - * - * @return string The value of the segment. If you specify the last +1 - * segment, the $default value. If you specify the last +2 - * or more throws HTTPException. - * - * @TODO remove this method after merging #7267 - */ - public function getSegment(int $number, string $default = ''): string - { - if ($number < 1) { - throw HTTPException::forURISegmentOutOfRange($number); - } - - if ($number > count($this->segments) + 1 && ! $this->silent) { - throw HTTPException::forURISegmentOutOfRange($number); - } - - // The segment should treat the array as 1-based for the user - // but we still have to deal with a zero-based array. - $number--; - - return $this->segments[$number] ?? $default; - } - /** * Formats the URI as a string. */