Fix EncoderInterface::encode() return type

This commit is contained in:
Jeroen Noten 2020-12-11 11:16:23 +01:00 committed by Nicolas Grekas
parent 150d8506e4
commit ae6f054cc1
2 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ interface EncoderInterface
* @param string $format Format name * @param string $format Format name
* @param array $context Options that normalizers/encoders have access to * @param array $context Options that normalizers/encoders have access to
* *
* @return string|int|float|bool * @return string
* *
* @throws UnexpectedValueException * @throws UnexpectedValueException
*/ */

View File

@ -67,9 +67,9 @@ class ChainEncoderTest extends TestCase
public function testEncode() public function testEncode()
{ {
$this->encoder1->expects($this->never())->method('encode'); $this->encoder1->expects($this->never())->method('encode');
$this->encoder2->expects($this->once())->method('encode'); $this->encoder2->expects($this->once())->method('encode')->willReturn('foo:123');
$this->chainEncoder->encode(['foo' => 123], self::FORMAT_2); $this->assertSame('foo:123', $this->chainEncoder->encode(['foo' => 123], self::FORMAT_2));
} }
public function testEncodeUnsupportedFormat() public function testEncodeUnsupportedFormat()