From 0188a81bc1814e2d09a6cfcd2985ad0a43fc838e Mon Sep 17 00:00:00 2001 From: zsc <985342160@qq.com> Date: Thu, 17 Oct 2024 14:30:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E6=95=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Encoder/Factory.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Encoder/Factory.php b/src/Encoder/Factory.php index 63ae4b5..4318794 100644 --- a/src/Encoder/Factory.php +++ b/src/Encoder/Factory.php @@ -27,11 +27,11 @@ public static function make(string $key): EncoderInterface */ public static function makeFromContentType(string $contentType): EncoderInterface { - if (stripos('xml', $contentType) !== false) { + if (stripos($contentType, 'xml') !== false) { $key = 'xml'; - } else if (stripos('json', $contentType) !== false) { + } else if (stripos($contentType, 'json') !== false) { $key = 'json'; - } else if (stripos('csv', $contentType) !== false) { + } else if (stripos($contentType, 'csv') !== false) { $key = 'csv'; } else { throw new \InvalidArgumentException('Unsupported: ' . $contentType);