Skip to content

Commit 33be8f4

Browse files
committed
ArrayFactory toArray() calls wrong method - Close #28
1 parent 55bbad1 commit 33be8f4

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/ValueObject/ArrayFactory.php

+2-2
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

tests/ValueObject/ArrayFactoryTest.php

+1-1
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

+1-1
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
/**

0 commit comments

Comments
 (0)