From eeadce6a52a522d6ecb710c58cfcc8ba90e91cc2 Mon Sep 17 00:00:00 2001 From: ignace nyamagana butera Date: Fri, 10 Jan 2025 12:08:24 +0100 Subject: [PATCH] #152 Fix wrong documentation for wrong class --- docs/components/7.0/hierarchical-path.md | 16 ++++++++++++++++ docs/components/7.0/path.md | 15 --------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/docs/components/7.0/hierarchical-path.md b/docs/components/7.0/hierarchical-path.md index 7ef3e4a1..d6662a21 100644 --- a/docs/components/7.0/hierarchical-path.md +++ b/docs/components/7.0/hierarchical-path.md @@ -134,3 +134,19 @@ HierarchicalPath::fromAbsolute('path','to', 'the', 'sky')->withoutSegment(0, 1)-

Just like the HierarchicalPath::get this method supports negative offset.

if the specified offset does not exist, no modification is performed and the current object is returned.

+ +### Removing empty segments + +Sometimes your path may contain multiple adjacent delimiters. Since removing them may result in a semantically different URI, this normalization can not be applied by default. To remove adjacent delimiters you can call the `Path::withoutEmptySegments` method which convert you path as described below: + +~~~php +withoutEmptySegments(); +echo $path; //displays 'path////to/the/sky//' +echo $newPath; //displays 'path/to/the/sky/' +~~~ + diff --git a/docs/components/7.0/path.md b/docs/components/7.0/path.md index ff26df93..661ad12a 100644 --- a/docs/components/7.0/path.md +++ b/docs/components/7.0/path.md @@ -58,21 +58,6 @@ echo $path; //displays 'path/to/./the/../the/sky%7bfoo%7d' echo $newPath; //displays 'path/to/the/sky%7Bfoo%7D' ~~~ -### Removing empty segments - -Sometimes your path may contain multiple adjacent delimiters. Since removing them may result in a semantically different URI, this normalization can not be applied by default. To remove adjacent delimiters you can call the `Path::withoutEmptySegments` method which convert you path as described below: - -~~~php -withoutEmptySegments(); -echo $path; //displays 'path////to/the/sky//' -echo $newPath; //displays 'path/to/the/sky/' -~~~ - ## Specialized Path Object What makes a URI specific apart from the scheme is how the path is parse and manipulated. This simple path class