Code Duplication    Length = 5-5 lines in 2 locations

src/Middleware/FormatNegotiator.php 2 locations

@@ 178-182 (lines=5) @@
175
            return;
176
        }
177
178
        foreach ($this->formats as $format => $data) {
179
            if (in_array($extension, $data[0], true)) {
180
                return $format;
181
            }
182
        }
183
    }
184
185
    /**
@@ 214-218 (lines=5) @@
211
        $mime = $this->negotiateHeader($accept, new Negotiator(), $headers);
212
213
        if ($mime !== null) {
214
            foreach ($this->formats as $format => $data) {
215
                if (in_array($mime, $data[1], true)) {
216
                    return $format;
217
                }
218
            }
219
        }
220
    }
221
}