1 | <?php |
||
18 | class FormattedResponder extends SortedDictionary implements ResponderInterface |
||
19 | { |
||
20 | use ResolverTrait; |
||
21 | use StructureWithDataAlias; |
||
22 | |||
23 | /** |
||
24 | * @var Negotiator |
||
25 | */ |
||
26 | private $negotiator; |
||
27 | |||
28 | /** |
||
29 | * @param Negotiator $negotiator |
||
30 | * @param ResolverInterface $resolver |
||
31 | */ |
||
32 | 10 | public function __construct( |
|
44 | |||
45 | /** |
||
46 | * @inheritDoc |
||
47 | */ |
||
48 | 5 | public function __invoke( |
|
60 | |||
61 | /** |
||
62 | * Determine if the payload has usable output |
||
63 | * |
||
64 | * @param PayloadInterface $payload |
||
65 | * |
||
66 | * @return boolean |
||
67 | */ |
||
68 | 5 | protected function hasOutput(PayloadInterface $payload) |
|
72 | |||
73 | /** |
||
74 | * Retrieve a map of accepted priorities with the responsible formatter. |
||
75 | * |
||
76 | * @return array |
||
77 | */ |
||
78 | 2 | protected function priorities() |
|
90 | |||
91 | /** |
||
92 | * Retrieve the formatter to use for the current request. |
||
93 | * |
||
94 | * Uses content negotiation to find the best available output format for |
||
95 | * the requested content type. |
||
96 | * |
||
97 | * @param ServerRequestInterface $request |
||
98 | * |
||
99 | * @return AbstractFormatter |
||
100 | */ |
||
101 | 2 | protected function formatter(ServerRequestInterface $request) |
|
118 | |||
119 | /** |
||
120 | * Update the response by formatting the payload. |
||
121 | * |
||
122 | * @param ResponseInterface $response |
||
123 | * @param AbstractFormatter $formatter |
||
124 | * @param PayloadInterface $payload |
||
125 | * |
||
126 | * @return ResponseInterface |
||
127 | */ |
||
128 | 2 | protected function format( |
|
141 | |||
142 | /** |
||
143 | * @inheritDoc |
||
144 | * |
||
145 | * @throws InvalidArgumentException |
||
146 | * If a formatter does not implement the correct interface, or does not |
||
147 | * have a quality value. |
||
148 | */ |
||
149 | 10 | protected function assertValid(array $data) |
|
170 | |||
171 | /** |
||
172 | * @inheritDoc |
||
173 | */ |
||
174 | 3 | protected function sortValues() |
|
178 | } |
||
179 |
This check looks for access to methods that are not accessible from the current context.
If you need to make a method accessible to another context you can raise its visibility level in the defining class.