Code Duplication    Length = 6-9 lines in 2 locations

src/Kunstmaan/AdminBundle/Helper/Toolbar/AbstractDataCollector.php 1 location

@@ 73-78 (lines=6) @@
70
            return false;
71
        }
72
73
        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
    }

src/Kunstmaan/AdminBundle/EventListener/ToolbarListener.php 1 location

@@ 170-178 (lines=9) @@
167
            return;
168
        }
169
170
        if ($response->isRedirection() || ($response->headers->has('Content-Type') && false === strpos(
171
                    $response->headers->get('Content-Type'),
172
                    'html'
173
                ))
174
            || 'html' !== $request->getRequestFormat()
175
            || false !== stripos($response->headers->get('Content-Disposition'), 'attachment;')
176
        ) {
177
            return;
178
        }
179
180
        $this->injectToolbar($response, $request);
181
    }