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