Skip to content

Commit b463bcf

Browse files
Use typed properties in tests as much as possible
1 parent ff8f32e commit b463bcf

File tree

6 files changed

+8
-17
lines changed

6 files changed

+8
-17
lines changed

Tests/ChatterTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@
2222

2323
class ChatterTest extends TestCase
2424
{
25-
/** @var MockObject&TransportInterface */
26-
private $transport;
27-
28-
/** @var MockObject&MessageBusInterface */
29-
private $bus;
25+
private MockObject&TransportInterface $transport;
26+
private MockObject&MessageBusInterface $bus;
3027

3128
protected function setUp(): void
3229
{

Tests/Event/FailedMessageEventTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testFailedMessageEventIsDisptachIfError()
5656
$clientMock = $this->createMock(HttpClientInterface::class);
5757

5858
$transport = new class($clientMock, $eventDispatcherMock) extends AbstractTransport {
59-
public $exception;
59+
public NullTransportException $exception;
6060

6161
public function __construct($client, EventDispatcherInterface $dispatcher = null)
6262
{

Tests/Fixtures/TestOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
final class TestOptions implements MessageOptionsInterface
1717
{
18-
private $options;
18+
private array $options;
1919

2020
public function __construct(array $options = [])
2121
{

Tests/Mailer/DummyMailer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class DummyMailer implements MailerInterface
2222
{
23-
private $sentMessage;
23+
private RawMessage $sentMessage;
2424

2525
public function send(RawMessage $message, Envelope $envelope = null): void
2626
{

Tests/TexterTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@
2222

2323
class TexterTest extends TestCase
2424
{
25-
/** @var MockObject&TransportInterface */
26-
private $transport;
27-
28-
/** @var MockObject&MessageBusInterface */
29-
private $bus;
25+
private MockObject&TransportInterface $transport;
26+
private MockObject&MessageBusInterface $bus;
3027

3128
protected function setUp(): void
3229
{

Tests/Transport/NullTransportFactoryTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@
2424
*/
2525
class NullTransportFactoryTest extends TestCase
2626
{
27-
/**
28-
* @var NullTransportFactory
29-
*/
30-
private $nullTransportFactory;
27+
private NullTransportFactory $nullTransportFactory;
3128

3229
protected function setUp(): void
3330
{

0 commit comments

Comments
 (0)