From 80031c9d152b8ca17bdfa082a3f883a22f3d11ef Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Wed, 31 May 2023 23:50:51 +0100 Subject: [PATCH 1/2] Remove unused if Signed-off-by: Kamil Tekiela --- psalm-baseline.xml | 3 --- src/Components/ExpressionArray.php | 16 ++++++---------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index e8ecda46f..dc7307d7e 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -255,9 +255,6 @@ $expr $expr - - is_array($ret) - diff --git a/src/Components/ExpressionArray.php b/src/Components/ExpressionArray.php index c206a4226..cf3422730 100644 --- a/src/Components/ExpressionArray.php +++ b/src/Components/ExpressionArray.php @@ -12,7 +12,6 @@ use function count; use function implode; -use function is_array; use function preg_match; use function strlen; use function substr; @@ -105,15 +104,12 @@ public static function parse(Parser $parser, TokensList $list, array $options = } --$list->idx; - - if (is_array($ret)) { - $retIndex = count($ret) - 1; - if (isset($ret[$retIndex])) { - $expr = $ret[$retIndex]->expr; - if (preg_match('/\s*--\s.*$/', $expr, $matches)) { - $found = $matches[0]; - $ret[$retIndex]->expr = substr($expr, 0, strlen($expr) - strlen($found)); - } + $retIndex = count($ret) - 1; + if (isset($ret[$retIndex])) { + $expr = $ret[$retIndex]->expr; + if (preg_match('/\s*--\s.*$/', $expr, $matches)) { + $found = $matches[0]; + $ret[$retIndex]->expr = substr($expr, 0, strlen($expr) - strlen($found)); } } From 1e4954eb4aa8139c007174ec906714b8a7a88dea Mon Sep 17 00:00:00 2001 From: Kamil Tekiela Date: Wed, 31 May 2023 23:54:14 +0100 Subject: [PATCH 2/2] Update psalm-baseline.xml Signed-off-by: Kamil Tekiela --- psalm-baseline.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/psalm-baseline.xml b/psalm-baseline.xml index dc7307d7e..ee79668b7 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -191,9 +191,6 @@ - - \AllowDynamicProperties - keyword]]]> keyword]]]> @@ -236,6 +233,9 @@ + + \AllowDynamicProperties + @@ -4914,9 +4914,6 @@ $built[$field] value]]]> - - \AllowDynamicProperties - __toString @@ -4952,6 +4949,9 @@ count($clauses) === 0 + + \AllowDynamicProperties + $index