public static function deserialize($data) { Assertion::isArray($data); $entities = array_map(function ($entity) { return Entity::deserialize($entity); }, $data); return new self($entities); }
/** * @test * @group metadata * * @dataProvider invalidDeserializationDataProvider * @expectedException InvalidArgumentException * * @param mixed $invalidData */ public function deserialization_requires_valid_data($invalidData) { Entity::deserialize($invalidData); }