code: public function encodes(string ...$mediaTypes): bool
      {
          $encoding = $this->getEncodingMediaType();
  
          return collect($mediaTypes)->contains(function ($mediaType, $index) use ($encoding) {
              return $encoding->equalsTo(MediaType::parse($index, $mediaType));
          });
      }
docs: Does the codec encode any of the supplied media types?
  
  @param string ...$mediaTypes
  @return bool