Skip to content

Commit 2dd550a

Browse files
committed
Merge remote-tracking branch 'origin/0.5.x-merge-up-into-0.6.x_gTYrRklu' into 0.6.x
# Conflicts: # CHANGELOG.md
2 parents 909cbdd + e02221a commit 2dd550a

File tree

6 files changed

+47
-5
lines changed

6 files changed

+47
-5
lines changed

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,44 @@ All notable changes to this project will be documented in this file, in reverse
2424

2525
- Nothing.
2626

27+
## 0.5.4 - 2021-07-27
28+
29+
30+
-----
31+
32+
### Release Notes for [0.5.4](https://github.com/open-code-modeling/json-schema-to-php-ast/milestone/15)
33+
34+
0.5.x bugfix release (patch)
35+
36+
### 0.5.4
37+
38+
- Total issues resolved: **1**
39+
- Total pull requests resolved: **0**
40+
- Total contributors: **1**
41+
42+
#### bug
43+
44+
- [28: ArrayFactory toArray() calls wrong method](https://github.com/open-code-modeling/json-schema-to-php-ast/issues/28) thanks to @sandrokeil
45+
46+
## 0.5.3 - 2021-02-18
47+
48+
49+
-----
50+
51+
### Release Notes for [0.5.3](https://github.com/open-code-modeling/json-schema-to-php-ast/milestone/14)
52+
53+
0.5.x bugfix release (patch)
54+
55+
### 0.5.3
56+
57+
- Total issues resolved: **1**
58+
- Total pull requests resolved: **0**
59+
- Total contributors: **1**
60+
61+
#### enhancement
62+
63+
- [26: Add namespace shortcut](https://github.com/open-code-modeling/json-schema-to-php-ast/issues/26) thanks to @sandrokeil
64+
2765
## 0.5.2 - 2021-02-16
2866

2967

src/ValueObject/ArrayFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
* public function toArray() : array
140140
* {
141141
* return \array_map(static function (ReasonType $reasonType) {
142-
* return $reasonType->toArray();
142+
* return $reasonType->toString();
143143
* }, $this->items);
144144
* }
145145
*
@@ -523,7 +523,7 @@ public function methodToArray(
523523
): MethodGenerator {
524524
$body = <<<'PHP'
525525
return \array_map(static function (%s $%s) {
526-
return $%s->toArray();
526+
return $%s->toString();
527527
}, $this->%s);
528528
PHP;
529529

src/ValueObjectFactory.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ private function extractNamespace(string $classNamespacePath, TypeDefinition $ty
376376
}
377377
$namespace = $typeDefinition->custom()['namespace'] ?? '';
378378

379+
if ($namespace === '') {
380+
$namespace = $typeDefinition->custom()['ns'] ?? '';
381+
}
382+
379383
return \trim($classNamespacePath . '\\' . $namespace, '\\');
380384
}
381385

tests/ValueObject/ArrayFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ public function items() : array
223223
public function toArray() : array
224224
{
225225
return \array_map(static function (ReasonType $reasonType) {
226-
return $reasonType->toArray();
226+
return $reasonType->toString();
227227
}, $this->items);
228228
}
229229
/**

tests/ValueObjectFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ public function items() : array
524524
public function toArray() : array
525525
{
526526
return \array_map(static function (Address $address) {
527-
return $address->toArray();
527+
return $address->toString();
528528
}, $this->shippingAddresses);
529529
}
530530
/**
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"billing_address": "Address|namespace:Billing",
3-
"address?": "ShippingAddresses|namespace:Payment"
3+
"address?": "ShippingAddresses|ns:Payment"
44
}

0 commit comments

Comments
 (0)