Skip to content

Commit

Permalink
couple of fixes for primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
dcarbone committed Jan 17, 2025
1 parent 9fc0e72 commit 09a7acd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
18 changes: 10 additions & 8 deletions template/versions/types/class_default.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,15 @@

// -- end field properties

echo require_with(
PHPFHIR_TEMPLATE_VERSION_TYPES_METHODS_DIR . '/constructor.php',
[
'version' => $version,
'type' => $type,
]
); ?>
if (!$type->hasPrimitiveOrListParent()) :
echo require_with(
PHPFHIR_TEMPLATE_VERSION_TYPES_METHODS_DIR . '/constructor.php',
[
'version' => $version,
'type' => $type,
]
);
endif; ?>

/**
* @return string
Expand All @@ -127,7 +129,7 @@ public function _getResourceType(): string
<?php
endif;

if ($type->hasLocalProperties()) :
if (!$type->hasPrimitiveOrListParent() && $type->hasLocalProperties()) :
echo "\n";

// --- property methods
Expand Down
2 changes: 1 addition & 1 deletion template/versions/types/properties/methods/primitive.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
public function getValue(): <?php echo TypeHintUtils::primitivePHPValueTypeHint($version, $primitiveType, true); ?>

{
return $this->value;
return $this->value ?? null;
}

<?php
Expand Down

0 comments on commit 09a7acd

Please sign in to comment.