|
@@ -274,8 +274,9 @@ class ValueObject
|
|
|
$this->createTypeDeclarationTokens($normalizedType, $isQuestionMarkSyntax)
|
|
|
);
|
|
|
|
|
|
- if (!$tokens[$typeAnalysis->getStartIndex() - 1]->equals('(')) {
|
|
|
- $tokens->ensureWhitespaceAtIndex($typeAnalysis->getStartIndex() - 1, 1, ' ');
|
|
|
+ $prevStartIndex = $typeAnalysis->getStartIndex() - 1;
|
|
|
+ if (!$tokens[$prevStartIndex]->isWhitespace() && !$tokens[$prevStartIndex]->equals('(')) {
|
|
|
+ $tokens->ensureWhitespaceAtIndex($prevStartIndex, 1, ' ');
|
|
|
}
|
|
|
}
|
|
|
|