|
|
|
@ -269,14 +269,10 @@ class Preprocessor extends CompilerBase |
|
|
|
if ($this->classDef->hasProperty($name)) { |
|
|
|
if ($this->classDef->hasProperty($name)) { |
|
|
|
$this->fatalError($param, "Duplicate property `{$name}`"); |
|
|
|
$this->fatalError($param, "Duplicate property `{$name}`"); |
|
|
|
} |
|
|
|
} |
|
|
|
// 将类型标准化为内部类型格式(如 array -> php::Array) |
|
|
|
$propClass = ''; |
|
|
|
if ($type instanceof NodeAbstract) { |
|
|
|
$propType = $this->parseTypeDecl($type, self::DECL_TYPE_OF_PROPERTY, $propClass); |
|
|
|
$dummyClass = ''; |
|
|
|
|
|
|
|
$propType = $this->parseTypeDecl($type, self::DECL_TYPE_OF_PROPERTY, $dummyClass); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
$propType = $this->zendTypeMap[strtolower($type)] ?? self::TYPE_VAR; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$propertyDef = new PropertyDef($name, $param->flags, $propType, $default, $nullable); |
|
|
|
$propertyDef = new PropertyDef($name, $param->flags, $propType, $default, $nullable); |
|
|
|
|
|
|
|
$propertyDef->class = $propClass; |
|
|
|
$this->classDef->properties[$name] = $propertyDef; |
|
|
|
$this->classDef->properties[$name] = $propertyDef; |
|
|
|
} |
|
|
|
} |
|
|
|
if ($param->variadic) { |
|
|
|
if ($param->variadic) { |
|
|
|
|