-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gen_stub] fix nested namespaced typed property in gen_stub.php #7418
Conversation
Can you please add a test to the zend_test extension? |
ed14a63
to
e459ef7
Compare
e459ef7
to
ef04abf
Compare
build/gen_stub.php
Outdated
@@ -1351,7 +1351,9 @@ public function getDeclaration(): string { | |||
if (count($arginfoType->classTypes) >= 2) { | |||
foreach ($arginfoType->classTypes as $classType) { | |||
$className = $classType->name; | |||
$code .= "\tzend_string *property_{$propertyName}_class_{$className} = zend_string_init(\"$className\", sizeof(\"$className\") - 1, 1);\n"; | |||
$escapedClassName = str_replace('\\', '\\\\', $className); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is $classType->toEscapedName()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks.
It seems to me that there is no ClassType
type and everything is SimpleType
, is this intended?
If it is intended, keep it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed this as well, and fixed the type hint in c1c1822.
gen_stub.php fails to auto-generate typed properties with nested namespaces.
There is nothing broken in php-src with this at the moment, but we will try to fix it as it is difficult to create an extension.