From 15914a10f0371ceaa7272c1243cf7eb00605ad64 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Thu, 1 Jun 2017 21:22:14 +0200 Subject: [PATCH] Add root path offset --- Uri/Http.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Uri/Http.php b/Uri/Http.php index b6362eb4e..b8755bb94 100644 --- a/Uri/Http.php +++ b/Uri/Http.php @@ -263,6 +263,14 @@ class Http implements UriInterface return $this->path; } + /** + * {@inheritdoc} + */ + public function getPathOffset() : int + { + return substr_count($this->rootPath, '/') - 1; + } + /** * {@inheritdoc} */