Skip to content

Commit c8b9741

Browse files
authored
fix(serializer): correct supported types for elasticsearch item normalizer decorator (#5769)
1 parent c9077e8 commit c8b9741

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Elasticsearch/Serializer/ItemNormalizer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function getSupportedTypes($format): array
111111
];
112112
}
113113

114-
return DocumentNormalizer::FORMAT === $format ? $this->decorated->getSupportedTypes($format) : [];
114+
return DocumentNormalizer::FORMAT !== $format ? $this->decorated->getSupportedTypes($format) : [];
115115
}
116116

117117
/**

tests/Elasticsearch/Serializer/ItemNormalizerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function getSupportedTypes(?string $format): array
166166
}
167167
});
168168

169-
$this->assertEmpty($this->itemNormalizer->getSupportedTypes('json'));
170-
$this->assertSame(['*' => true], $this->itemNormalizer->getSupportedTypes($this->itemNormalizer::FORMAT));
169+
$this->assertEmpty($this->itemNormalizer->getSupportedTypes($this->itemNormalizer::FORMAT));
170+
$this->assertSame(['*' => true], $this->itemNormalizer->getSupportedTypes('json'));
171171
}
172172
}

0 commit comments

Comments
 (0)