minor #30716 Fixing bad return on getter (weaverryan)

This PR was merged into the 4.3-dev branch.

Discussion
----------

Fixing bad return on getter

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | none
| License       | MIT
| Doc PR        | not needed

My bad - this method is only to make the Symfony Serializer happy (not used in our code), so I missed it. Test added to be sure.

Commits
-------

f3b3b2f4f3 Fixing bad return on getter
This commit is contained in:
Fabien Potencier 2019-03-27 07:27:38 +01:00
commit 08faa536d1
2 changed files with 9 additions and 2 deletions

View File

@ -40,9 +40,9 @@ class RedeliveryStamp implements StampInterface
*
* @internal
*/
public function getSenderClassOrAlias(): int
public function getSenderClassOrAlias(): string
{
return $this->retryCount;
return $this->senderClassOrAlias;
}
public function shouldRedeliverToSender(string $senderClass, ?string $senderAlias): bool

View File

@ -31,4 +31,11 @@ class RedeliveryStampTest extends TestCase
$this->assertTrue($stampToRedeliverToSender1->shouldRedeliverToSender('App\Sender1', null));
$this->assertFalse($stampToRedeliverToSender1->shouldRedeliverToSender('App\Sender2', null));
}
public function testGetters()
{
$stamp = new RedeliveryStamp(10, 'sender_alias');
$this->assertSame(10, $stamp->getRetryCount());
$this->assertSame('sender_alias', $stamp->getSenderClassOrAlias());
}
}