File tree Expand file tree Collapse file tree 1 file changed +0
-30
lines changed Expand file tree Collapse file tree 1 file changed +0
-30
lines changed Original file line number Diff line number Diff line change @@ -252,36 +252,6 @@ public function getRoutePath(): string
252252 return $ this ->routePath ;
253253 }
254254
255- /**
256- * Returns the value of a specific segment of the URI path.
257- * Allows to get only existing segments or the next one.
258- *
259- * @param int $number Segment number starting at 1
260- * @param string $default Default value
261- *
262- * @return string The value of the segment. If you specify the last +1
263- * segment, the $default value. If you specify the last +2
264- * or more throws HTTPException.
265- *
266- * @TODO remove this method after merging #7267
267- */
268- public function getSegment (int $ number , string $ default = '' ): string
269- {
270- if ($ number < 1 ) {
271- throw HTTPException::forURISegmentOutOfRange ($ number );
272- }
273-
274- if ($ number > count ($ this ->segments ) + 1 && ! $ this ->silent ) {
275- throw HTTPException::forURISegmentOutOfRange ($ number );
276- }
277-
278- // The segment should treat the array as 1-based for the user
279- // but we still have to deal with a zero-based array.
280- $ number --;
281-
282- return $ this ->segments [$ number ] ?? $ default ;
283- }
284-
285255 /**
286256 * Formats the URI as a string.
287257 */
You can’t perform that action at this time.
0 commit comments