mirror of
https://github.com/barryvdh/ReflectionDocBlock.git
synced 2026-08-18 01:57:13 +00:00
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:
@@ -59,6 +59,6 @@ final class Return_ extends TagWithType implements Factory\StaticMethod
|
||||
|
||||
$type = $this->type ? '' . $this->type : 'mixed';
|
||||
|
||||
return $type . ($description !== '' ? ($type !== '' ? ' ' : '') . $description : '');
|
||||
return $type . ($description !== '' ? ' ' . $description : '');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user