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.
This commit is contained in:
jrfnl
2021-08-08 21:32:56 +02:00
committed by Jaapio
parent f5118ce302
commit 7172d132a3
+1 -1
View File
@@ -59,6 +59,6 @@ final class Return_ extends TagWithType implements Factory\StaticMethod
$type = $this->type ? '' . $this->type : 'mixed'; $type = $this->type ? '' . $this->type : 'mixed';
return $type . ($description !== '' ? ($type !== '' ? ' ' : '') . $description : ''); return $type . ($description !== '' ? ' ' . $description : '');
} }
} }