Code Duplication    Length = 5-5 lines in 2 locations

src/Middleware/FormatNegotiator.php 2 locations

@@ 187-191 (lines=5) @@
184
            return;
185
        }
186
187
        foreach ($this->formats as $format => $data) {
188
            if (in_array($extension, $data[0], true)) {
189
                return $format;
190
            }
191
        }
192
    }
193
194
    /**
@@ 205-209 (lines=5) @@
202
        $mime = $this->negotiateHeader($request->getHeaderLine('Accept'), new Negotiator(), $headers);
203
204
        if ($mime !== null) {
205
            foreach ($this->formats as $format => $data) {
206
                if (in_array($mime, $data[1], true)) {
207
                    return $format;
208
                }
209
            }
210
        }
211
    }
212
}