From 30a61855929e8cdaa7a90f0003e1cbdab621069a Mon Sep 17 00:00:00 2001 From: Daniel Carbone Date: Tue, 7 Jan 2025 17:31:59 -0600 Subject: [PATCH] getting there --- src/Utilities/TypeHintUtils.php | 4 +++- template/versions/types/methods/constructor.php | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/Utilities/TypeHintUtils.php b/src/Utilities/TypeHintUtils.php index f05cd766..ac91b539 100644 --- a/src/Utilities/TypeHintUtils.php +++ b/src/Utilities/TypeHintUtils.php @@ -141,7 +141,9 @@ public static function typeSetterTypeHint(Version $version, Type $type, bool $nu $tk = $type->getKind(); $types = $nullable ? ['null'] : []; - if ($tk === TypeKindEnum::PRIMITIVE_CONTAINER) { + if ($tk->isResourceContainer($version)) { + $types[] = PHPFHIR_VERSION_INTERFACE_VERSION_CONTAINED_TYPE; + } else if ($tk === TypeKindEnum::PRIMITIVE_CONTAINER) { $pt = $type->getProperties()->getProperty('value')->getValueFHIRType(); $types = array_merge($types, $pt->getPrimitiveType()->getPHPReceiveValueTypeHints()); array_push( diff --git a/template/versions/types/methods/constructor.php b/template/versions/types/methods/constructor.php index 96324b24..bf98d203 100644 --- a/template/versions/types/methods/constructor.php +++ b/template/versions/types/methods/constructor.php @@ -139,9 +139,11 @@ public function __construct(null|array $data = null, /** * Constructor - * @param null|array $dataisValueContainer()) : ?> + * @param null|array $data +isValueContainer()) : ?> - * @param $value = null + * @param $value = null + getAllPropertiesIndexedIterator() as $property) : $pt = $property->getValueFHIRType(); if ($type->isValueContainer() && $property->isValueProperty()) { @@ -151,7 +153,15 @@ public function __construct(null|array $data = null, * @param $getName(); ?> */ - public function __construct(null|arrayisValueContainer()) : ?>| $data = null) + public function __construct(null|array $data = nullisValueContainer()) : ?>, + $value = null +getAllPropertiesIndexedIterator() as $property) : + if ($type->isValueContainer() && $property->isValueProperty()) { + continue; + } + ?>, + $getName(); ?> +) { if (null === $data || [] === $data) { hasParent()) : ?>