Opengraph
Opengraph copied to clipboard
Feat.: Write Opengraph from Json
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.
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.
@brunomp see: euskadi31/Opengraph#10
I release after merge your PR :)