Skip to content

Commit a1815c9

Browse files
authored
Merge pull request #11 from php-api-clients/be-ware-of-special-characters-in-property-names
Be wary of special characters in property names
2 parents 75c152c + ca62b4f commit a1815c9

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/Generator/Schema.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,6 @@ public static function generate(string $name, string $namespace, string $classNa
3737
Class_::MODIFIER_PUBLIC
3838
)
3939
)->addStmt(
40-
new Node\Stmt\ClassConst(
41-
[
42-
new Node\Const_(
43-
'SPL_HASH',
44-
new Node\Scalar\String_(
45-
spl_object_hash($schema)
46-
)
47-
),
48-
],
49-
Class_::MODIFIER_PUBLIC
50-
))->addStmt(
5140
new Node\Stmt\ClassConst(
5241
[
5342
new Node\Const_(
@@ -62,6 +51,7 @@ public static function generate(string $name, string $namespace, string $classNa
6251
);
6352

6453
foreach ($schema->properties as $propertyName => $property) {
54+
$propertyName = trim($propertyName, '@');
6555
$propertyStmt = $factory->property($propertyName)->makePrivate();
6656
$docBlock = [];
6757
if (strlen($property->description) > 0) {

0 commit comments

Comments
 (0)