From 26dc6472a6ba9b12487ec2d3f76d5d7273454bd4 Mon Sep 17 00:00:00 2001 From: samuelgfeller Date: Mon, 18 Mar 2024 20:38:54 +0100 Subject: [PATCH] Cs fix --- src/Traits/ContainerTestTrait.php | 2 +- src/Traits/DatabaseSchemaTestTrait.php | 2 +- src/Traits/DatabaseTableTestTrait.php | 6 +++--- src/Traits/HttpJsonTestTrait.php | 2 +- src/Traits/HttpTestTrait.php | 2 +- src/Traits/MailerTestTrait.php | 14 +++++++------- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Traits/ContainerTestTrait.php b/src/Traits/ContainerTestTrait.php index bf4071c..1d9e66e 100644 --- a/src/Traits/ContainerTestTrait.php +++ b/src/Traits/ContainerTestTrait.php @@ -27,7 +27,7 @@ trait ContainerTestTrait * * @return void */ - protected function setUpContainer(ContainerInterface $container = null): void + protected function setUpContainer(?ContainerInterface $container = null): void { if ($container instanceof ContainerInterface) { $this->container = $container; diff --git a/src/Traits/DatabaseSchemaTestTrait.php b/src/Traits/DatabaseSchemaTestTrait.php index 2600d2e..fb2d6c4 100644 --- a/src/Traits/DatabaseSchemaTestTrait.php +++ b/src/Traits/DatabaseSchemaTestTrait.php @@ -22,7 +22,7 @@ trait DatabaseSchemaTestTrait * * @return void */ - protected function setUpDatabase(string $schemaFile = null): void + protected function setUpDatabase(?string $schemaFile = null): void { if (isset($schemaFile)) { $this->schemaFile = $schemaFile; diff --git a/src/Traits/DatabaseTableTestTrait.php b/src/Traits/DatabaseTableTestTrait.php index 13396b9..30afa6b 100644 --- a/src/Traits/DatabaseTableTestTrait.php +++ b/src/Traits/DatabaseTableTestTrait.php @@ -25,7 +25,7 @@ protected function assertTableRow( array $expectedRow, string $table, int $id, - array $fields = null, + ?array $fields = null, string $message = '' ): void { $this->assertSame( @@ -46,7 +46,7 @@ protected function assertTableRow( * * @return array Row */ - protected function getTableRowById(string $table, int $id, array $fields = null): array + protected function getTableRowById(string $table, int $id, ?array $fields = null): array { $sql = sprintf('SELECT * FROM `%s` WHERE `id` = :id', $table); $statement = $this->createPreparedStatement($sql); @@ -80,7 +80,7 @@ protected function assertTableRowEquals( array $expectedRow, string $table, int $id, - array $fields = null, + ?array $fields = null, string $message = '' ): void { $this->assertEquals( diff --git a/src/Traits/HttpJsonTestTrait.php b/src/Traits/HttpJsonTestTrait.php index 3822222..da57fa4 100644 --- a/src/Traits/HttpJsonTestTrait.php +++ b/src/Traits/HttpJsonTestTrait.php @@ -22,7 +22,7 @@ trait HttpJsonTestTrait * * @return ServerRequestInterface */ - protected function createJsonRequest(string $method, $uri, array $data = null): ServerRequestInterface + protected function createJsonRequest(string $method, $uri, ?array $data = null): ServerRequestInterface { $request = $this->createRequest($method, $uri); diff --git a/src/Traits/HttpTestTrait.php b/src/Traits/HttpTestTrait.php index e53a82a..8b5d7fc 100644 --- a/src/Traits/HttpTestTrait.php +++ b/src/Traits/HttpTestTrait.php @@ -46,7 +46,7 @@ protected function createRequest(string $method, $uri, array $serverParams = []) * * @return ServerRequestInterface The request */ - protected function createFormRequest(string $method, $uri, array $data = null): ServerRequestInterface + protected function createFormRequest(string $method, $uri, ?array $data = null): ServerRequestInterface { $request = $this->createRequest($method, $uri); diff --git a/src/Traits/MailerTestTrait.php b/src/Traits/MailerTestTrait.php index 16f0530..31de1c6 100644 --- a/src/Traits/MailerTestTrait.php +++ b/src/Traits/MailerTestTrait.php @@ -25,12 +25,12 @@ */ trait MailerTestTrait { - protected function assertEmailCount(int $count, string $transport = null, string $message = ''): void + protected function assertEmailCount(int $count, ?string $transport = null, string $message = ''): void { $this->assertThat($this->getMessageMailerEvents(), new EmailCount($count, $transport), $message); } - protected function assertQueuedEmailCount(int $count, string $transport = null, string $message = ''): void + protected function assertQueuedEmailCount(int $count, ?string $transport = null, string $message = ''): void { $this->assertThat( $this->getMessageMailerEvents(), @@ -120,12 +120,12 @@ protected function assertEmailAddressContains( * * @return MessageEvent[] */ - protected function getMailerEvents(string $transport = null): array + protected function getMailerEvents(?string $transport = null): array { return $this->getMessageMailerEvents()->getEvents($transport); } - protected function getMailerEvent(int $index = 0, string $transport = null): ?MessageEvent + protected function getMailerEvent(int $index = 0, ?string $transport = null): ?MessageEvent { return $this->getMailerEvents($transport)[$index] ?? null; } @@ -135,17 +135,17 @@ protected function getMailerEvent(int $index = 0, string $transport = null): ?Me * * @return RawMessage[] */ - protected function getMailerMessages(string $transport = null): array + protected function getMailerMessages(?string $transport = null): array { return $this->getMessageMailerEvents()->getMessages($transport); } - protected function findMailerMessage(int $index = 0, string $transport = null): ?RawMessage + protected function findMailerMessage(int $index = 0, ?string $transport = null): ?RawMessage { return $this->getMailerMessages($transport)[$index] ?? null; } - protected function getMailerMessage(int $index = 0, string $transport = null): RawMessage + protected function getMailerMessage(int $index = 0, ?string $transport = null): RawMessage { $message = $this->findMailerMessage($index, $transport);