@@ -98,6 +98,9 @@ discard block |
||
| 98 | 98 | return new static($scheme, $root, $segments, $separator); |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | + /** |
|
| 102 | + * @param string $input |
|
| 103 | + */ |
|
| 101 | 104 | protected static function extractScheme($input) |
| 102 | 105 | { |
| 103 | 106 | $position = strpos($input, '://'); |
@@ -107,11 +110,18 @@ discard block |
||
| 107 | 110 | return substr($input, 0, $position); |
| 108 | 111 | } |
| 109 | 112 | |
| 113 | + /** |
|
| 114 | + * @param string $input |
|
| 115 | + * @param string $scheme |
|
| 116 | + */ |
|
| 110 | 117 | protected static function stripScheme($input, $scheme) |
| 111 | 118 | { |
| 112 | 119 | return empty($scheme) ? $input : substr($input, strlen($scheme) + 3); |
| 113 | 120 | } |
| 114 | 121 | |
| 122 | + /** |
|
| 123 | + * @param string $platform |
|
| 124 | + */ |
|
| 115 | 125 | protected static function containsRoot(array $segments, $platform) |
| 116 | 126 | { |
| 117 | 127 | if (empty($segments)) { |
@@ -298,7 +308,7 @@ discard block |
||
| 298 | 308 | * If path schemes differ, or not both paths are relative/absolute, this |
| 299 | 309 | * method will instantly return false. |
| 300 | 310 | * |
| 301 | - * @param Path|string $other |
|
| 311 | + * @param Path $other |
|
| 302 | 312 | * @return bool |
| 303 | 313 | */ |
| 304 | 314 | public function isDescendantOf($other) |
@@ -344,7 +354,7 @@ discard block |
||
| 344 | 354 | * If path schemes differ, or not both paths are relative/absolute, this |
| 345 | 355 | * method will instantly return false. |
| 346 | 356 | * |
| 347 | - * @param Path|string $other |
|
| 357 | + * @param Path $other |
|
| 348 | 358 | * @return bool |
| 349 | 359 | */ |
| 350 | 360 | public function isChildOf($other) |
@@ -363,7 +373,7 @@ discard block |
||
| 363 | 373 | * If path schemes differ, or not both paths are relative/absolute, this |
| 364 | 374 | * method will instantly return false. |
| 365 | 375 | * |
| 366 | - * @param Path|string $other |
|
| 376 | + * @param Path $other |
|
| 367 | 377 | * @return bool |
| 368 | 378 | */ |
| 369 | 379 | public function isParentOf($other) |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | * @param string $segment |
| 206 | 206 | * @return string[] |
| 207 | 207 | */ |
| 208 | - $reducer = function ($carrier, $segment) { |
|
| 208 | + $reducer = function($carrier, $segment) { |
|
| 209 | 209 | if ($segment === '' || $segment === '.') { |
| 210 | 210 | return $carrier; |
| 211 | 211 | } |
@@ -614,12 +614,12 @@ discard block |
||
| 614 | 614 | { |
| 615 | 615 | $builder = ''; |
| 616 | 616 | if (!empty($this->scheme)) { |
| 617 | - $builder .= $this->scheme . '://'; |
|
| 617 | + $builder .= $this->scheme.'://'; |
|
| 618 | 618 | } |
| 619 | 619 | if ($this->root !== null) { |
| 620 | - $builder .= $this->root . $separator; |
|
| 620 | + $builder .= $this->root.$separator; |
|
| 621 | 621 | } |
| 622 | - return $builder . implode($separator, $this->segments); |
|
| 622 | + return $builder.implode($separator, $this->segments); |
|
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | /** |