| 1 | <?php |
||
| 7 | abstract class ContentHandler |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * Parses request bodies based on content type. |
||
| 11 | * |
||
| 12 | * @param ServerRequestInterface $request |
||
| 13 | * @param ResponseInterface $response |
||
| 14 | * @param callable $next |
||
| 15 | * |
||
| 16 | * @return Response |
||
| 17 | */ |
||
| 18 | 5 | public function __invoke( |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Check if the content type is appropriate for handling. |
||
| 36 | * |
||
| 37 | * @param string $mime |
||
| 38 | * |
||
| 39 | * @return boolean |
||
| 40 | */ |
||
| 41 | abstract protected function isApplicableMimeType($mime); |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Parse the request body. |
||
| 45 | * |
||
| 46 | * @param string $body |
||
| 47 | * |
||
| 48 | * @return mixed |
||
| 49 | */ |
||
| 50 | abstract protected function getParsedBody($body); |
||
| 51 | } |
||
| 52 |
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.