Skip to content

Instantly share code, notes, and snippets.

@jwage
Created December 12, 2013 16:02
Show Gist options
  • Save jwage/b04f64a786bf31a53317 to your computer and use it in GitHub Desktop.
Save jwage/b04f64a786bf31a53317 to your computer and use it in GitHub Desktop.
<?php
namespace OpenSky\Bundle\APIBundle\Serializer;
use JMS\Serializer\JsonSerializationVisitor;
class ArraySerializationVisitor extends JsonSerializationVisitor
{
public function getResult()
{
return $this->getRoot();
}
}
array_serialization_provider:
class: ArraySerializationVisitor
arguments:
- @jms_serializer.naming_strategy
tags:
- { name: jms_serializer.serialization_visitor, format: array }
@yapro
Copy link

yapro commented Dec 13, 2015

How to use it without symfony?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment