Skip to content

Commit 80031c9

Browse files
committed
Remove unused if
Signed-off-by: Kamil Tekiela <tekiela246@gmail.com>
1 parent 9e99de5 commit 80031c9

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

psalm-baseline.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,6 @@
255255
<code>$expr</code>
256256
<code>$expr</code>
257257
</PossiblyNullArgument>
258-
<RedundantCondition>
259-
<code>is_array($ret)</code>
260-
</RedundantCondition>
261258
</file>
262259
<file src="src/Components/FunctionCall.php">
263260
<MixedOperand>

src/Components/ExpressionArray.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use function count;
1414
use function implode;
15-
use function is_array;
1615
use function preg_match;
1716
use function strlen;
1817
use function substr;
@@ -105,15 +104,12 @@ public static function parse(Parser $parser, TokensList $list, array $options =
105104
}
106105

107106
--$list->idx;
108-
109-
if (is_array($ret)) {
110-
$retIndex = count($ret) - 1;
111-
if (isset($ret[$retIndex])) {
112-
$expr = $ret[$retIndex]->expr;
113-
if (preg_match('/\s*--\s.*$/', $expr, $matches)) {
114-
$found = $matches[0];
115-
$ret[$retIndex]->expr = substr($expr, 0, strlen($expr) - strlen($found));
116-
}
107+
$retIndex = count($ret) - 1;
108+
if (isset($ret[$retIndex])) {
109+
$expr = $ret[$retIndex]->expr;
110+
if (preg_match('/\s*--\s.*$/', $expr, $matches)) {
111+
$found = $matches[0];
112+
$ret[$retIndex]->expr = substr($expr, 0, strlen($expr) - strlen($found));
117113
}
118114
}
119115

0 commit comments

Comments
 (0)