|
@@ -307,18 +307,18 @@ class ValueObject
|
|
|
private function createTypeDeclarationTokens(array $types, bool $isQuestionMarkSyntax): array
|
|
|
{
|
|
|
static $specialTypes = [
|
|
|
- '?' => [CT::T_NULLABLE_TYPE, '?'],
|
|
|
- 'array' => [CT::T_ARRAY_TYPEHINT, 'array'],
|
|
|
- 'callable' => [T_CALLABLE, 'callable'],
|
|
|
- 'static' => [T_STATIC, 'static'],
|
|
|
+ '?' => CT::T_NULLABLE_TYPE,
|
|
|
+ 'array' => CT::T_ARRAY_TYPEHINT,
|
|
|
+ 'callable' => T_CALLABLE,
|
|
|
+ 'static' => T_STATIC,
|
|
|
];
|
|
|
|
|
|
$count = \count($types);
|
|
|
$newTokens = [];
|
|
|
|
|
|
foreach ($types as $index => $type) {
|
|
|
- if (isset($specialTypes[$type])) {
|
|
|
- $newTokens[] = new Token($specialTypes[$type]);
|
|
|
+ if (isset($specialTypes[strtolower($type)])) {
|
|
|
+ $newTokens[] = new Token([$specialTypes[strtolower($type)], $type]);
|
|
|
} else {
|
|
|
foreach (explode('\\', $type) as $nsIndex => $value) {
|
|
|
if (0 === $nsIndex && '' === $value) {
|