src/Codec/EncodingList.php
public function matchesTo(MediaTypeInterface $mediaType): ?Encoding
    {
        return collect($this->stack)->first(function (Encoding $encoding) use ($mediaType) {
            return $encoding->matchesTo($mediaType);
        });
    }
public function matchesTo(MediaTypeInterface $mediaType): ?Encoding
    {
        return collect($this->stack)->first(function (Encoding $encoding) use ($mediaType) {
            return $encoding->matchesTo($mediaType);
        });
    }
Get the encoding that matches the supplied media type.

@param MediaTypeInterface $mediaType
@return Encoding|null