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

@@ 176-184 (lines=9) @@
173
            return;
174
        }
175
176
        if ($response->isRedirection() || ($response->headers->has('Content-Type') && false === strpos(
177
                    $response->headers->get('Content-Type'),
178
                    'html'
179
                ))
180
            || 'html' !== $request->getRequestFormat()
181
            || false !== stripos($response->headers->get('Content-Disposition'), 'attachment;')
182
        ) {
183
            return;
184
        }
185
186
        $this->injectToolbar($response, $request);
187
    }