From c12db8eee4f1930d0dfc4073e31dd351e3adc99f Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 8 Sep 2024 18:39:46 +0200 Subject: [PATCH] Fix PHPStan 1.12.2 ``` ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Line src/IRI.php ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ :304 Offset 3 on array{0: string, 1: '', scheme: null, 2: string, 3: string, authority: string, 4: string, path: string, ...}|array{0: string, 1: non-empty-string, scheme: string, 2: string, 3: string, authority: string, 4: string, path: string, ...} in isset() always exists and is not nullable. :307 Offset 5 on array{0: string, 1: '', scheme: null, 2: string, 3: string, authority: string|null, 4: string, path: string, ...}|array{0: string, 1: non-empty-string, scheme: string, 2: string, 3: string, authority: string|null, 4: string, path: string, ...} in isset() always exists and is not nullable. ------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ``` --- src/IRI.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/IRI.php b/src/IRI.php index fd906c1a..4b35b6e9 100644 --- a/src/IRI.php +++ b/src/IRI.php @@ -301,12 +301,10 @@ protected function parse_iri(string $iri) if ($match[1] === '') { $match['scheme'] = null; } - if (!isset($match[3]) || $match[3] === '') { + if ($match[3] === '') { $match['authority'] = null; } - if (!isset($match[5])) { - $match['path'] = ''; - } + $match['path'] = ''; if (!isset($match[6]) || $match[6] === '') { $match['query'] = null; }