4040$ unserializeConfig = $ coreFiles ->getCoreFileByEntityName (PHPFHIR_ENCODING_CLASSNAME_UNSERIALIZE_CONFIG );
4141$ serializeConfig = $ coreFiles ->getCoreFileByEntityName (PHPFHIR_ENCODING_CLASSNAME_SERIALIZE_CONFIG );
4242
43+ $ mockAbstractTypeClass = $ testCoreFiles ->getCoreFileByEntityName (PHPFHIR_TEST_CLASSNAME_ABSTRACT_MOCK_TYPE );
4344$ mockTypeFieldsTrait = $ testCoreFiles ->getCoreFileByEntityName (PHPFHIR_TEST_TRAIT_MOCK_TYPE_FIELDS );
4445$ mockStringpPrimitiveClass = $ testCoreFiles ->getCoreFileByEntityName (PHPFHIR_TEST_CLASSNAME_MOCK_STRING_PRIMITIVE_TYPE );
4546$ mockResourceIDClass = $ testCoreFiles ->getCoreFileByEntityName (PHPFHIR_TEST_CLASSNAME_MOCK_RESOURCE_ID_TYPE );
6061 $ unserializeConfig ,
6162 $ serializeConfig ,
6263
64+ $ mockAbstractTypeClass ,
6365 $ mockTypeFieldsTrait ,
6466 $ mockStringpPrimitiveClass ,
6567 $ mockResourceIDClass ,
7476
7577<?php echo ImportUtils::compileImportStatements ($ imports ); ?>
7678
77- class <?php echo $ coreFile ; ?> implements <?php echo $ resourceTypeInterface ; ?> , <?php echo $ commentContainerInterface ; ?> , \Iterator
79+ class <?php echo $ coreFile ; ?> extends <?php echo $ mockAbstractTypeClass ; ?> implements <?php echo $ resourceTypeInterface ; ?> , <?php echo $ commentContainerInterface ; ?> , \Iterator
7880
7981{
8082 use <?php echo $ typeValidationTrait ; ?> ,
@@ -86,35 +88,19 @@ class <?php echo $coreFile; ?> implements <?php echo $resourceTypeInterface; ?>,
8688
8789 private const _FHIR_VALIDATION_RULES = [];
8890
89- protected string $_name;
90- protected <?php echo $ fhirVersion ; ?> $_fhirVersion;
91-
9291 private array $_valueXMLLocations = [];
9392
9493 public function __construct(string $name,
9594 null|string|<?php echo $ mockStringpPrimitiveClass ; ?> |<?php echo $ mockResourceIDClass ; ?> $id = null,
9695 array $fields = [],
9796 array $validationRuleMap = [],
9897 array $fhirComments = [],
99- string $versionName = 'mock' ,
100- string $semanticVersion = 'v0.0.0' )
98+ string $versionName = self::DEFAULT_MOCK_VERSION_NAME ,
99+ string $semanticVersion = self::DEFAULT_MOCK_SEMANTIC_VERSION )
101100 {
102- $this->_name = $name;
103- $this->_setFHIRComments($fhirComments);
104-
105- $shortVersion = ltrim($semanticVersion, 'v');
106- $shortVersion = match (substr_count($shortVersion, '.')) {
107- 1 => $shortVersion,
108- 2 => substr($shortVersion, 0, strrpos($shortVersion, '.')),
109- default => implode('.', array_chunk(explode('.', $shortVersion), 2)[0])
110- };
101+ parent::__construct($name, $versionName, $semanticVersion);
111102
112- $this->_fhirVersion = new <?php echo $ fhirVersion ; ?> (
113- $versionName,
114- $semanticVersion,
115- $shortVersion,
116- intval(sprintf("%'.-08s", str_replace(['v', '.'], '', $semanticVersion))),
117- );
103+ $this->_setFHIRComments($fhirComments);
118104
119105 $fields['id'] = [
120106 'class' => <?php echo $ mockResourceIDClass ; ?> ::class,
@@ -131,16 +117,6 @@ public function __construct(string $name,
131117 $this->_processFields($fields);
132118 }
133119
134- public function _getFHIRTypeName(): string
135- {
136- return $this->_name;
137- }
138-
139- public function _getFHIRVersion(): <?php echo $ fhirVersion ; ?>
140- {
141- return $this->_fhirVersion;
142- }
143-
144120 public function getId(): null|<?php echo $ resourceIDTypeInterface ; ?>
145121
146122 {
@@ -155,7 +131,8 @@ public static function xmlUnserialize(\SimpleXMLElement|string $element,
155131 throw new \BadMethodCallException('xmlUnserialize not yet implemented');
156132 }
157133
158- public function xmlSerialize(null|<?php echo $ xmlWriterClass ; ?> $xw = null, null|<?php echo $ serializeConfig ; ?> $config = null): <?php echo $ xmlWriterClass ; ?>
134+ public function xmlSerialize(null|<?php echo $ xmlWriterClass ; ?> $xw = null,
135+ null|<?php echo $ serializeConfig ; ?> $config = null): <?php echo $ xmlWriterClass ; ?>
159136
160137 {
161138 if (null === $config) {
@@ -187,7 +164,9 @@ public function xmlSerialize(null|<?php echo $xmlWriterClass; ?> $xw = null, nul
187164 return $xw;
188165 }
189166
190- public static function jsonUnserialize(string|\stdClass $json, null|<?php echo $ unserializeConfig ; ?> $config = null, null|<?php echo $ resourceTypeInterface ; ?> $type = null): <?php echo $ resourceTypeInterface ; ?>
167+ public static function jsonUnserialize(string|\stdClass $json,
168+ null|<?php echo $ unserializeConfig ; ?> $config = null,
169+ null|<?php echo $ resourceTypeInterface ; ?> $type = null): <?php echo $ resourceTypeInterface ; ?>
191170
192171 {
193172 throw new \BadMethodCallException('jsonUnserialize not yet implemented');
0 commit comments