Skip to content

Commit 23d1093

Browse files
committed
TASK: Ensure classnames are postprocessed and prefixed with \
1 parent 7e422fe commit 23d1093

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Classes/Command/NodetypeObjectsCommandController.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ private function buildOne(FlowPackageInterface $package, NodeType $nodeType, str
9696
if (str_ends_with($type, '[]')) {
9797
$phpType = 'array';
9898
} elseif (str_starts_with($type, 'array<') && str_ends_with($type, '>')) {
99+
$annotationType = substr($type , 6 ,-1) . '[]';
99100
$phpType = 'array';
100101
} elseif ($type === 'boolean') {
101102
$phpType = 'bool';
@@ -106,9 +107,13 @@ private function buildOne(FlowPackageInterface $package, NodeType $nodeType, str
106107
} elseif ($type === 'DateTime') {
107108
$phpType = '\DateTime';
108109
$annotationType = '\DateTime';
109-
} elseif (str_contains($type, '\\') && !str_starts_with($type, '\\')) {
110-
$annotationType = '\\' . $type;
111-
$phpType = '\\' . $type;
110+
}
111+
112+
if (str_contains($phpType, '\\') && !str_starts_with($phpType, '\\')) {
113+
$phpType = '\\' . $phpType;
114+
}
115+
if (str_contains($annotationType, '\\') && !str_starts_with($annotationType, '\\')) {
116+
$annotationType = '\\' . $annotationType;
112117
}
113118

114119
$propertyAccesssors .= <<<EOL

0 commit comments

Comments
 (0)