Skip to content

Commit 7172d13

Browse files
jrfnljaapio
authored andcommitted
Tags/Return: remove redundant condition
Psalm flags this condition as redundant: ``` ERROR: RedundantCondition - src/DocBlock/Tags/Return_.php:62:48 - "" can never contain non-empty-lowercase-string (see https://psalm.dev/122) return $type . ($description !== '' ? ($type !== '' ? ' ' : '') . $description : ''); ``` Based on the statement in the line above - `$type = $this->type ? '' . $this->type : 'mixed';` -, Psalm is correct and the `$type` variable can never be an empty string.
1 parent f5118ce commit 7172d13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/DocBlock/Tags/Return_.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,6 @@ public function __toString(): string
5959

6060
$type = $this->type ? '' . $this->type : 'mixed';
6161

62-
return $type . ($description !== '' ? ($type !== '' ? ' ' : '') . $description : '');
62+
return $type . ($description !== '' ? ' ' . $description : '');
6363
}
6464
}

0 commit comments

Comments
 (0)