MagicTheGathering/mtg-sdk-php

Convert php object Card into js object

AzaeI opened this issue · 6 comments

AzaeI commented

I'm getting Card object in php .
When i use json_encode on the card object, i got an empty object.

This could be fixed by implementing JsonSerialize on the Card object, but I'd put the method implementation on the DataBag trait so that other objects can also easily serialize to json.

Want to give it a shot?

AzaeI commented

Yeah sure.
if Set can be serialize to json too, it'll be nice

Both Card and Set use DataBag, so it could be implemented in both!

AzaeI commented

I don't really understand exactly how it works ,
I'm just a beginner using your api ;)
Thanks for responding that fast btw.
It'll take sometime to fix it ?

Take your time to understand the project and how it works right now, then make a pull request with your changes.
Open source work is done by the community, so if you need something, you do your best to contribute it yourself. What you ask for is not a bugfix, so I don't have any urgency of implementing it myself, but I'd be glad to accept your PR.

Hope you can pull it off! I'm sure you'll learn something along the way ;-)

AzaeI commented

Well, i'll try :-)