1 | <?php |
||
10 | class PropertyParserBuilder |
||
11 | { |
||
12 | /** |
||
13 | * @var \Mcustiel\SimpleRequest\Interfaces\ValidatorInterface[] |
||
14 | */ |
||
15 | private $validators = []; |
||
16 | /** |
||
17 | * @var \Mcustiel\SimpleRequest\Interfaces\FilterInterface[] |
||
18 | */ |
||
19 | private $filters = []; |
||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $name; |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $type; |
||
28 | |||
29 | 97 | public function __construct($name) |
|
33 | |||
34 | /** |
||
35 | * Adds a validator to the parser. |
||
36 | * |
||
37 | * @param \Mcustiel\SimpleRequest\Interfaces\ValidatorInterface $validator |
||
38 | */ |
||
39 | 95 | public function addValidator(ValidatorInterface $validator) |
|
44 | |||
45 | /** |
||
46 | * Adds a filter to the parser. |
||
47 | * |
||
48 | * @param \Mcustiel\SimpleRequest\Interfaces\FilterInterface $filter |
||
49 | */ |
||
50 | 16 | public function addFilter(FilterInterface $filter) |
|
55 | |||
56 | /** |
||
57 | * Sets the type to parse the object to. |
||
58 | * |
||
59 | * @param string $type |
||
60 | */ |
||
61 | 2 | public function parseAs($type) |
|
66 | |||
67 | /** |
||
68 | * @param \Mcustiel\SimpleRequest\RequestBuilder $requestBuilder |
||
69 | */ |
||
70 | 97 | public function build(RequestBuilder $requestBuilder) |
|
76 | |||
77 | 97 | private function createPropertyParser(RequestBuilder $requestBuilder) |
|
84 | } |
||
85 |