From 8114f3567f2572edd1cf278b8f9efc1d7e8e2cba Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Mon, 19 Sep 2022 18:58:32 +0200 Subject: [PATCH] Applied automated CS fixes --- bin/console.php | 4 ++-- src/HttpClient/LoggingHttpClient.php | 2 +- src/Monolog/ConvertLogContextHttpRequestsIntoStrings.php | 4 +++- src/Monolog/ConvertLogContextHttpResponsesIntoStrings.php | 4 +++- test/unit/HttpClient/LoggingHttpClientTest.php | 3 --- .../ConvertLogContextHttpResponsesIntoStringsTest.php | 6 ------ test/unit/Monolog/VerifyLoggingIntegrationTest.php | 3 +++ 7 files changed, 12 insertions(+), 14 deletions(-) diff --git a/bin/console.php b/bin/console.php index db616ff1..8ce3080d 100755 --- a/bin/console.php +++ b/bin/console.php @@ -63,8 +63,8 @@ static function (int $errorCode, string $message = '', string $file = '', int $l E_STRICT | E_NOTICE | E_WARNING, ); - $variables = EnvironmentVariables::fromEnvironment(new ImportGpgKeyFromStringViaTemporaryFile()); - $logger = new Logger( + $variables = EnvironmentVariables::fromEnvironment(new ImportGpgKeyFromStringViaTemporaryFile()); + $logger = new Logger( 'automatic-releases', [new StreamHandler(STDERR, $variables->logLevel())], [ diff --git a/src/HttpClient/LoggingHttpClient.php b/src/HttpClient/LoggingHttpClient.php index 666835ba..ae78092c 100644 --- a/src/HttpClient/LoggingHttpClient.php +++ b/src/HttpClient/LoggingHttpClient.php @@ -32,4 +32,4 @@ public function sendRequest(RequestInterface $request): ResponseInterface return $response; } -} \ No newline at end of file +} diff --git a/src/Monolog/ConvertLogContextHttpRequestsIntoStrings.php b/src/Monolog/ConvertLogContextHttpRequestsIntoStrings.php index e6109a1d..aefa803f 100644 --- a/src/Monolog/ConvertLogContextHttpRequestsIntoStrings.php +++ b/src/Monolog/ConvertLogContextHttpRequestsIntoStrings.php @@ -8,6 +8,8 @@ use Monolog\Processor\ProcessorInterface; use Psr\Http\Message\RequestInterface; +use function array_map; + /** @internal */ final class ConvertLogContextHttpRequestsIntoStrings implements ProcessorInterface { @@ -34,4 +36,4 @@ public function __invoke(LogRecord $record): LogRecord $record->formatted ); } -} \ No newline at end of file +} diff --git a/src/Monolog/ConvertLogContextHttpResponsesIntoStrings.php b/src/Monolog/ConvertLogContextHttpResponsesIntoStrings.php index 0551a481..e0dc833a 100644 --- a/src/Monolog/ConvertLogContextHttpResponsesIntoStrings.php +++ b/src/Monolog/ConvertLogContextHttpResponsesIntoStrings.php @@ -8,6 +8,8 @@ use Monolog\Processor\ProcessorInterface; use Psr\Http\Message\ResponseInterface; +use function array_map; + /** @internal */ final class ConvertLogContextHttpResponsesIntoStrings implements ProcessorInterface { @@ -34,4 +36,4 @@ public function __invoke(LogRecord $record): LogRecord $record->formatted ); } -} \ No newline at end of file +} diff --git a/test/unit/HttpClient/LoggingHttpClientTest.php b/test/unit/HttpClient/LoggingHttpClientTest.php index 3bc20e3f..ad8ded63 100644 --- a/test/unit/HttpClient/LoggingHttpClientTest.php +++ b/test/unit/HttpClient/LoggingHttpClientTest.php @@ -6,12 +6,9 @@ use Http\Discovery\Psr17FactoryDiscovery; use Laminas\AutomaticReleases\HttpClient\LoggingHttpClient; -use Monolog\Handler\StreamHandler; -use Monolog\Logger; use PHPUnit\Framework\TestCase; use Psr\Http\Client\ClientInterface; use Psr\Log\LoggerInterface; -use function fopen; /** @covers \Laminas\AutomaticReleases\HttpClient\LoggingHttpClient */ final class LoggingHttpClientTest extends TestCase diff --git a/test/unit/Monolog/ConvertLogContextHttpResponsesIntoStringsTest.php b/test/unit/Monolog/ConvertLogContextHttpResponsesIntoStringsTest.php index 717cf7c8..72effb9d 100644 --- a/test/unit/Monolog/ConvertLogContextHttpResponsesIntoStringsTest.php +++ b/test/unit/Monolog/ConvertLogContextHttpResponsesIntoStringsTest.php @@ -6,16 +6,10 @@ use DateTimeImmutable; use Http\Discovery\Psr17FactoryDiscovery; -use Laminas\AutomaticReleases\HttpClient\LoggingHttpClient; -use Laminas\AutomaticReleases\Monolog\ConvertLogContextHttpRequestsIntoStrings; use Laminas\AutomaticReleases\Monolog\ConvertLogContextHttpResponsesIntoStrings; -use Monolog\Handler\StreamHandler; use Monolog\Level; -use Monolog\Logger; use Monolog\LogRecord; use PHPUnit\Framework\TestCase; -use Psr\Http\Client\ClientInterface; -use function fopen; /** @covers \Laminas\AutomaticReleases\Monolog\ConvertLogContextHttpResponsesIntoStrings */ final class ConvertLogContextHttpResponsesIntoStringsTest extends TestCase diff --git a/test/unit/Monolog/VerifyLoggingIntegrationTest.php b/test/unit/Monolog/VerifyLoggingIntegrationTest.php index 0a91c342..462b8dd5 100644 --- a/test/unit/Monolog/VerifyLoggingIntegrationTest.php +++ b/test/unit/Monolog/VerifyLoggingIntegrationTest.php @@ -10,7 +10,10 @@ use Monolog\Handler\StreamHandler; use Monolog\Logger; use PHPUnit\Framework\TestCase; + use function fopen; +use function rewind; +use function stream_get_contents; /** * Small integration test to ensure future compatibility with monolog in our setup.