Code Duplication    Length = 5-5 lines in 2 locations

src/Middleware/FormatNegotiator.php 2 locations

@@ 175-179 (lines=5) @@
172
            return;
173
        }
174
175
        foreach ($this->formats as $format => $data) {
176
            if (in_array($extension, $data[0], true)) {
177
                return $format;
178
            }
179
        }
180
    }
181
182
    /**
@@ 200-204 (lines=5) @@
197
        $mime = $this->negotiateHeader($accept, new Negotiator(), $headers);
198
199
        if ($mime !== null) {
200
            foreach ($this->formats as $format => $data) {
201
                if (in_array($mime, $data[1], true)) {
202
                    return $format;
203
                }
204
            }
205
        }
206
    }
207
}