Opengraph icon indicating copy to clipboard operation
Opengraph copied to clipboard

Feat.: Write Opengraph from Json

Open brunomp opened this issue 6 years ago • 3 comments

Hello,

I created a function that makes an Opengraph from a Json. I did not do the Unity Test because I do not know how to use Atoum.

I needed this function because I saved in the database the Json returned from getArrayCopy() and I need to restore the object afterwards.

What do you think? Thank you.

brunomp avatar Jan 25 '19 01:01 brunomp

I think it would be better to modify the constructor to take an array as an optional argument.

src/Opengraph/Writer.php

    public function __construct($properties = [])
    {
        parent::__construct();

        if(!empty($properties)) {
           //....
        }
    }

For unit test, we can change to phpunit if it suits you.

euskadi31 avatar Jan 25 '19 12:01 euskadi31

@brunomp see: euskadi31/Opengraph#10

euskadi31 avatar Jan 25 '19 13:01 euskadi31

I release after merge your PR :)

euskadi31 avatar Jan 25 '19 13:01 euskadi31