Skip to content

Commit ac7693a

Browse files
committed
small cleanup, getting json unserialization prepped
1 parent 103539e commit ac7693a

File tree

4 files changed

+85
-2
lines changed

4 files changed

+85
-2
lines changed

template/versions/types/serialization/json.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,39 @@
2424
$typeKind = $type->getKind();
2525

2626
ob_start();
27+
28+
//echo require_with(
29+
// PHPFHIR_TEMPLATE_VERSION_TYPES_SERIALIZATION_DIR
30+
// . DIRECTORY_SEPARATOR
31+
// . 'json'
32+
// . DIRECTORY_SEPARATOR
33+
// . 'unserialize'
34+
// . DIRECTORY_SEPARATOR
35+
// . 'header.php',
36+
// [
37+
// 'version' => $version,
38+
// 'type' => $type,
39+
// ]
40+
//);
41+
//
42+
//echo "\n";
43+
//
44+
//echo require_with(
45+
// PHPFHIR_TEMPLATE_VERSION_TYPES_SERIALIZATION_DIR
46+
// . DIRECTORY_SEPARATOR
47+
// . 'json'
48+
// . DIRECTORY_SEPARATOR
49+
// . 'unserialize'
50+
// . DIRECTORY_SEPARATOR
51+
// . 'body.php',
52+
// [
53+
// 'version' => $version,
54+
// 'type' => $type,
55+
// ]
56+
//);
57+
//
58+
//echo "\n";
59+
2760
if ($typeKind->isOneOf(TypeKindEnum::PRIMITIVE, TypeKindEnum::LIST)) :
2861
echo require_with(
2962
PHPFHIR_TEMPLATE_VERSION_TYPES_SERIALIZATION_DIR
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php declare(strict_types=1);
2+
3+
/*
4+
* Copyright 2025 Daniel Carbone (daniel.p.carbone@gmail.com)
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
19+
/** @var \DCarbone\PHPFHIR\Version $version */
20+
/** @var \DCarbone\PHPFHIR\Version\Definition\Type $type; */
21+
22+
$typeKind = $type->getKind();
23+
24+
ob_start(); ?>
25+
26+
<?php return ob_get_clean();
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php declare(strict_types=1);
2+
3+
/*
4+
* Copyright 2025 Daniel Carbone (daniel.p.carbone@gmail.com)
5+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
/** @var \DCarbone\PHPFHIR\Version $version */
19+
/** @var \DCarbone\PHPFHIR\Version\Definition\Type $type; */
20+
21+
$typeKind = $type->getKind();
22+
23+
ob_start(); ?>
24+
public static function jsonUnserialize(string|array|\stdClass $data
25+
26+
<?php return ob_get_clean();

template/versions/types/serialization/xml.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
* limitations under the License.
1717
*/
1818

19-
use DCarbone\PHPFHIR\Enum\TypeKindEnum;
20-
2119
/** @var \DCarbone\PHPFHIR\Version $version */
2220
/** @var \DCarbone\PHPFHIR\Version\Definition\Type $type; */
2321

0 commit comments

Comments
 (0)