1 | <?php |
||
19 | final class OptionsRenderer implements RenderInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var Reader |
||
23 | */ |
||
24 | private $reader; |
||
25 | |||
26 | /** |
||
27 | * @var OptionsMethods |
||
28 | */ |
||
29 | private $optionsMethod; |
||
30 | |||
31 | /** |
||
32 | * @param Reader $reader |
||
33 | */ |
||
34 | 84 | public function __construct(Reader $reader) |
|
35 | { |
||
36 | 84 | $this->reader = $reader; |
|
37 | 84 | $this->optionsMethod = new OptionsMethods($reader); |
|
38 | 84 | } |
|
39 | |||
40 | /** |
||
41 | * {@inheritdoc} |
||
42 | */ |
||
43 | 4 | public function render(ResourceObject $ro) |
|
53 | |||
54 | /** |
||
55 | * Return allowed methods |
||
56 | * |
||
57 | * @param \ReflectionMethod[] $methods |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | 4 | private function getAllows(array $methods) |
|
72 | |||
73 | /** |
||
74 | * Return OPTIONS entity body |
||
75 | * |
||
76 | * @param ResourceObject $ro |
||
77 | * @param array $allows |
||
78 | * |
||
79 | * @return array |
||
80 | */ |
||
81 | 4 | private function getEntityBody(ResourceObject $ro, $allows) |
|
90 | } |
||
91 |