Skip to content

Commit 394ffa6

Browse files
jeroennotennicolas-grekas
authored andcommitted
Fix EncoderInterface::encode() return type
1 parent 2bd74df commit 394ffa6

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Encoder/EncoderInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ interface EncoderInterface
2525
* @param string $format Format name
2626
* @param array $context Options that normalizers/encoders have access to
2727
*
28-
* @return string|int|float|bool
28+
* @return string
2929
*
3030
* @throws UnexpectedValueException
3131
*/

Tests/Encoder/ChainEncoderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,9 @@ public function testSupportsEncoding()
6767
public function testEncode()
6868
{
6969
$this->encoder1->expects($this->never())->method('encode');
70-
$this->encoder2->expects($this->once())->method('encode');
70+
$this->encoder2->expects($this->once())->method('encode')->willReturn('foo:123');
7171

72-
$this->chainEncoder->encode(['foo' => 123], self::FORMAT_2);
72+
$this->assertSame('foo:123', $this->chainEncoder->encode(['foo' => 123], self::FORMAT_2));
7373
}
7474

7575
public function testEncodeUnsupportedFormat()

0 commit comments

Comments
 (0)