| Conditions | 9 |
| Paths | 3 |
| Total Lines | 18 |
| Lines | 6 |
| Ratio | 33.33 % |
| Tests | 0 |
| CRAP Score | 90 |
| Changes | 0 | ||
| 1 | <?php |
||
| 64 | public function showDataCollection(Request $request, Response $response) |
||
| 65 | { |
||
| 66 | $url = $request->getRequestUri(); |
||
| 67 | |||
| 68 | // do not capture redirects or modify XML HTTP Requests |
||
| 69 | if ($request->isXmlHttpRequest() || $this->adminRouteHelper->isAdminRoute($url) || !$this->isEnabled()) { |
||
| 70 | return false; |
||
| 71 | } |
||
| 72 | |||
| 73 | View Code Duplication | if ($response->isRedirection() || ($response->headers->has('Content-Type') && false === strpos($response->headers->get('Content-Type'), 'html')) |
|
| 74 | || 'html' !== $request->getRequestFormat() |
||
| 75 | || false !== stripos($response->headers->get('Content-Disposition'), 'attachment;') |
||
| 76 | ) { |
||
| 77 | return false; |
||
| 78 | } |
||
| 79 | |||
| 80 | return true; |
||
| 81 | } |
||
| 82 | } |
||
| 83 |
This check looks for the generic type
arrayas a return type and suggests a more specific type. This type is inferred from the actual code.