Code Duplication    Length = 5-5 lines in 2 locations

src/Middleware/FormatNegotiator.php 2 locations

@@ 165-169 (lines=5) @@
162
            return;
163
        }
164
165
        foreach ($this->formats as $format => $data) {
166
            if (in_array($extension, $data[0], true)) {
167
                return $format;
168
            }
169
        }
170
    }
171
172
    /**
@@ 183-187 (lines=5) @@
180
        $mime = $this->negotiateHeader($request->getHeaderLine('Accept'), new Negotiator(), $headers);
181
182
        if ($mime !== null) {
183
            foreach ($this->formats as $format => $data) {
184
                if (in_array($mime, $data[1], true)) {
185
                    return $format;
186
                }
187
            }
188
        }
189
    }
190
}