1 | <?php |
||
15 | class Object2Array |
||
16 | { |
||
17 | /** |
||
18 | * @var Object2ArrayContext |
||
19 | */ |
||
20 | private $context; |
||
21 | |||
22 | /** |
||
23 | * @param Object2ArrayContext $context |
||
24 | */ |
||
25 | public function __construct(Object2ArrayContext $context) |
||
29 | |||
30 | /** |
||
31 | * @return Object2ArrayContext |
||
32 | */ |
||
33 | public function getContext() |
||
37 | |||
38 | /** |
||
39 | * @param Object2ArrayContext $context |
||
40 | * |
||
41 | * @return $this |
||
42 | */ |
||
43 | public function setContext(Object2ArrayContext $context) |
||
49 | |||
50 | /** |
||
51 | * @param object $object object instance to traverse |
||
52 | * |
||
53 | * @throws \InvalidArgumentException |
||
54 | * |
||
55 | * @return array |
||
56 | */ |
||
57 | public function createArray($object) |
||
93 | |||
94 | /** |
||
95 | * Parse a value using given types. |
||
96 | * |
||
97 | * @param mixed $value |
||
98 | * @param array $types |
||
99 | * @param \ReflectionProperty $property |
||
100 | * @param object $object |
||
101 | * |
||
102 | * @return array|bool|float|int|string |
||
103 | */ |
||
104 | private function parseValue($value, $types, \ReflectionProperty $property, $object) |
||
124 | } |
||
125 |