Skip to content

Commit

Permalink
参数问题
Browse files Browse the repository at this point in the history
  • Loading branch information
z985342160 committed Oct 17, 2024
1 parent 0318bb6 commit 0188a81
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Encoder/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0188a81

Please sign in to comment.