Skip to content

Commit ac18b41

Browse files
Hackwarrichard67
authored andcommitted
Fixing notices from phpstan
1 parent c600931 commit ac18b41

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

src/AbstractUri.php

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ abstract class AbstractUri implements UriInterface
7575
/**
7676
* Query
7777
*
78-
* @var string
78+
* @var ?string
7979
* @since 1.0
8080
*/
8181
protected $query;
@@ -405,19 +405,17 @@ protected function cleanPath($path)
405405
$path = explode('/', preg_replace('#(/+)#', '/', $path));
406406

407407
for ($i = 0, $n = \count($path); $i < $n; $i++) {
408-
if ($path[$i] == '.' || $path[$i] == '..') {
409-
if (($path[$i] == '.') || ($path[$i] == '..' && $i == 1 && $path[0] == '')) {
410-
unset($path[$i]);
411-
$path = array_values($path);
412-
$i--;
413-
$n--;
414-
} elseif ($path[$i] == '..' && ($i > 1 || ($i == 1 && $path[0] != ''))) {
415-
unset($path[$i], $path[$i - 1]);
416-
417-
$path = array_values($path);
418-
$i -= 2;
419-
$n -= 2;
420-
}
408+
if (($path[$i] == '.') || ($path[$i] == '..' && $i == 1 && $path[0] == '')) {
409+
unset($path[$i]);
410+
$path = array_values($path);
411+
$i--;
412+
$n--;
413+
} elseif ($path[$i] == '..' && ($i > 1 || ($i == 1 && $path[0] != ''))) {
414+
unset($path[$i], $path[$i - 1]);
415+
416+
$path = array_values($path);
417+
$i -= 2;
418+
$n -= 2;
421419
}
422420
}
423421

0 commit comments

Comments
 (0)