1 | <?php |
||
17 | class FormattedResponder extends Dictionary implements ResponderInterface |
||
18 | { |
||
19 | use ResolverTrait; |
||
20 | |||
21 | /** |
||
22 | * @var Negotiator |
||
23 | */ |
||
24 | private $negotiator; |
||
25 | |||
26 | /** |
||
27 | * @param Negotiator $negotiator |
||
28 | * @param ResolverInterface $resolver |
||
29 | */ |
||
30 | 9 | public function __construct( |
|
42 | |||
43 | /** |
||
44 | * @inheritDoc |
||
45 | */ |
||
46 | 9 | public function validate(array $data) |
|
67 | |||
68 | /** |
||
69 | * @inheritDoc |
||
70 | */ |
||
71 | 5 | public function __invoke( |
|
83 | |||
84 | /** |
||
85 | * Determine if the payload has usable output |
||
86 | * |
||
87 | * @param PayloadInterface $payload |
||
88 | * |
||
89 | * @return boolean |
||
90 | */ |
||
91 | 5 | protected function hasOutput(PayloadInterface $payload) |
|
95 | |||
96 | /** |
||
97 | * Retrieve a map of accepted priorities with the responsible formatter. |
||
98 | * |
||
99 | * @return array |
||
100 | */ |
||
101 | 2 | protected function priorities() |
|
113 | |||
114 | /** |
||
115 | * Retrieve the formatter to use for the current request. |
||
116 | * |
||
117 | * Uses content negotiation to find the best available output format for |
||
118 | * the requested content type. |
||
119 | * |
||
120 | * @param ServerRequestInterface $request |
||
121 | * |
||
122 | * @return AbstractFormatter |
||
123 | */ |
||
124 | 2 | protected function formatter(ServerRequestInterface $request) |
|
141 | |||
142 | /** |
||
143 | * Update the response by formatting the payload. |
||
144 | * |
||
145 | * @param ResponseInterface $response |
||
146 | * @param AbstractFormatter $formatter |
||
147 | * @param PayloadInterface $payload |
||
148 | * |
||
149 | * @return ResponseInterface |
||
150 | */ |
||
151 | 2 | protected function format( |
|
164 | } |
||
165 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.