1 | <?php |
||
9 | class PropertyParserToObject extends SimplePropertyParser |
||
10 | { |
||
11 | /** |
||
12 | * @var \Mcustiel\SimpleRequest\RequestBuilder |
||
13 | */ |
||
14 | private $requestBuilder; |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | private $type; |
||
19 | |||
20 | public function __construct($name, $type, RequestBuilder $requestBuilder) |
||
26 | |||
27 | /** |
||
28 | * {@inheritdoc} |
||
29 | * |
||
30 | * @see \Mcustiel\SimpleRequest\Strategies\Properties\SimplePropertyParser::parse() |
||
31 | */ |
||
32 | public function parse($propertyValue) |
||
41 | |||
42 | /** |
||
43 | * Parses the value as it is an instance of the class specified in type property. |
||
44 | * |
||
45 | * @param array|\stdClass $value The value to parse and convert to an object |
||
46 | * |
||
47 | * @throws \Mcustiel\SimpleRequest\Exception\InvalidAnnotationException |
||
48 | * @return object Parsed value as instance of class specified in type property |
||
49 | */ |
||
50 | private function createInstanceOfTypeFromValue($value) |
||
62 | } |
||
63 |