-
Notifications
You must be signed in to change notification settings - Fork 6
/
inheritance.php
39 lines (31 loc) · 879 Bytes
/
inheritance.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
use Spray\Serializer\AnnotationBackedPropertyInfo;
use Spray\Serializer\Cache\ArrayCache;
use Spray\Serializer\Object\ObjectSerializerGenerator;
use Spray\Serializer\Object\SerializerLocator;
use Spray\Serializer\Object\SerializerRegistry;
use Spray\Serializer\ObjectListener;
use Spray\Serializer\ObjectTypeListener;
use Spray\Serializer\Serializer;
chdir(dirname(__DIR__));
require 'vendor/autoload.php';
$serializer = new Serializer();
$serializer->attach(
new ObjectTypeListener(),
new ObjectListener(
new SerializerLocator(
new SerializerRegistry(),
new ObjectSerializerGenerator(
new AnnotationBackedPropertyInfo()
),
new ArrayCache('Serializer')
)
)
);
var_export($serializer->serialize(new SerializeMe()));
class ExtendMe
{
}
class SerializeMe extends ExtendMe
{
}