Skip to content

Commit

Permalink
Fix typo in method name in gen_stub.php
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Aug 31, 2021
1 parent 6871a49 commit 39ede67
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build/gen_stub.php
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ public function toEscapedName(): string {
return str_replace('\\', '\\\\', $this->name);
}

public function toCVarEscapedName(): string {
public function toVarEscapedName(): string {
$name = str_replace('_', '__', $this->name);
return str_replace('\\', '_', $this->name);
}
Expand Down Expand Up @@ -1425,7 +1425,7 @@ public function getDeclaration(): string {
foreach ($arginfoType->classTypes as $classType) {
$className = $classType->name;
$escapedClassName = $classType->toEscapedName();
$varEscapedClassName = $classType->toCVarEscapedName();
$varEscapedClassName = $classType->toVarEscapedName();
$code .= "\tzend_string *property_{$propertyName}_class_{$varEscapedClassName} = zend_string_init(\"{$escapedClassName}\", sizeof(\"{$escapedClassName}\") - 1, 1);\n";
}

Expand All @@ -1446,7 +1446,7 @@ public function getDeclaration(): string {
} else {
$className = $arginfoType->classTypes[0]->name;
$escapedClassName = $arginfoType->classTypes[0]->toEscapedName();
$varEscapedClassName = $arginfoType->classTypes[0]->toCVarEscapedName();
$varEscapedClassName = $arginfoType->classTypes[0]->toVarEscapedName();
$code .= "\tzend_string *property_{$propertyName}_class_{$varEscapedClassName} = zend_string_init(\"{$escapedClassName}\", sizeof(\"${escapedClassName}\")-1, 1);\n";

$typeCode = "(zend_type) ZEND_TYPE_INIT_CLASS(property_{$propertyName}_class_{$varEscapedClassName}, 0, " . $arginfoType->toTypeMask() . ")";
Expand Down

2 comments on commit 39ede67

@nikic
Copy link
Member

@nikic nikic commented on 39ede67 Aug 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this was a typo: "CVar" as in "C variable". But maybe dropping the C is better ^^

@kocsismate
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's a shame. I assumed that it's a typo because these letters are next to each other, and I usually make the very same typo.

Please sign in to comment.