Skip to content

Commit 8f779b4

Browse files
committed
match keys to constructor args
1 parent fb31cc6 commit 8f779b4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Brick/MoneyNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function normalize($object, string $format = null, array $context = [])
1919
}
2020

2121
return [
22-
'minor' => $object->getMinorAmount()->toInt(),
22+
'amount' => $object->getMinorAmount()->toInt(),
2323
'currency' => $object->getCurrency()->getCurrencyCode(),
2424
];
2525
}
@@ -37,7 +37,7 @@ public function supportsNormalization($data, string $format = null)
3737
*/
3838
public function denormalize($data, string $type, string $format = null, array $context = [])
3939
{
40-
return Money::ofMinor($data['minor'], $data['currency']);
40+
return Money::ofMinor($data['amount'], $data['currency']);
4141
}
4242

4343
/**

src/Money/MoneyNormalizer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function normalize($object, string $format = null, array $context = [])
2020
}
2121

2222
return [
23-
'minor' => $object->getAmount(),
23+
'amount' => $object->getAmount(),
2424
'currency' => $object->getCurrency()->getCode(),
2525
];
2626
}
@@ -38,7 +38,7 @@ public function supportsNormalization($data, string $format = null)
3838
*/
3939
public function denormalize($data, string $type, string $format = null, array $context = [])
4040
{
41-
return new Money($data['minor'], new Currency($data['currency']));
41+
return new Money($data['amount'], new Currency($data['currency']));
4242
}
4343

4444
/**

0 commit comments

Comments
 (0)