Code Duplication    Length = 4-4 lines in 2 locations

src/Negotiation/AcceptNegotiator.php 1 location

@@ 59-62 (lines=4) @@
56
            $headerValueParts = explode(';', $headerValue);
57
            $mimeType = trim(array_shift($headerValueParts));
58
            $attributes = [];
59
            foreach ($headerValueParts as $attribute) {
60
                list($attributeKey, $attributeValue) = explode('=', $attribute);
61
                $attributes[trim($attributeKey)] = trim($attributeValue);
62
            }
63
64
            if (!isset($attributes['q'])) {
65
                $attributes['q'] = '1.0';

src/Negotiation/ContentTypeNegotiator.php 1 location

@@ 59-62 (lines=4) @@
56
        $headerValueParts = explode(';', $header);
57
        $mimeType = trim(array_shift($headerValueParts));
58
        $attributes = [];
59
        foreach ($headerValueParts as $attribute) {
60
            list($attributeKey, $attributeValue) = explode('=', $attribute);
61
            $attributes[trim($attributeKey)] = trim($attributeValue);
62
        }
63
64
        if (in_array($mimeType, $this->supportedMimeTypes, true)) {
65
            return new NegotiatedValue($mimeType, $attributes);