You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Both Money and Currency classes implement the \JsonSerializable. 👍
When the Money::jsonSerialize() is used in a (string) context, \json_encode returns the proper JSON representations, since to Currency::jsonSerialize() is implicitly called.
But if the Money::jsonSerialize() is called alone, it returns an instance of Currency for the currency key, instead of its code.
IMHO opinion, this could be: 'currency' => $this->currency->getCode(),.
The text was updated successfully, but these errors were encountered:
zek
added a commit
to zek/money
that referenced
this issue
Feb 19, 2019
Hi,
Both
Money
andCurrency
classes implement the\JsonSerializable
. 👍When the
Money::jsonSerialize()
is used in a(string)
context,\json_encode
returns the proper JSON representations, since toCurrency::jsonSerialize()
is implicitly called.But if the
Money::jsonSerialize()
is called alone, it returns an instance ofCurrency
for thecurrency
key, instead of itscode
.IMHO opinion, this could be:
'currency' => $this->currency->getCode(),
.The text was updated successfully, but these errors were encountered: