Skip to content

Commit

Permalink
Revert "662 - fix issue with default value within NodeFactory"
Browse files Browse the repository at this point in the history
This reverts commit 4562e45.
  • Loading branch information
simonschaufi committed Mar 26, 2024
1 parent 561ebad commit b38deb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 4 additions & 4 deletions Classes/Parser/ClassFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public function buildPropertyObject(Property $propertyNode): Model\ClassObject\P
foreach ($propertyNode->props as $subNode) {
if ($subNode instanceof PropertyProperty) {
$propertyName = $subNode->name->name;
if ($subNode->getAttribute('default')) {
$propertyDefault = $subNode->getAttribute('default');
if ($subNode->default) {
$propertyDefault = $subNode->default;
}
}
}
Expand Down Expand Up @@ -149,8 +149,8 @@ protected function setFunctionProperties(Stmt $node, FunctionObject $object): Fu
$parameter->setTypeForParamTag($paramTag[0]);
}
}
if ($param->getAttribute('default') !== null) {
$parameter->setDefaultValue($param->getAttribute('default'));
if ($param->default !== null) {
$parameter->setDefaultValue($param->default);
}
$object->setParameter($parameter);
$position++;
Expand Down
4 changes: 1 addition & 3 deletions Classes/Parser/NodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,7 @@ public function buildPropertyNode(Property $property): Stmt\Property
}

$this->addCommentAttributes($property, $propertyNode);
// TODO: consider to remove the next line as I cannot see, where it is used
// See https://github.com/FriendsOfTYPO3/extension_builder/issues/662
$propertyNode->setAttribute('default', $property->getDefault());
$propertyNode->default = $property->getDefault();
return $propertyNode;
}

Expand Down

0 comments on commit b38deb1

Please sign in to comment.