Skip to content

Commit 1f6df0e

Browse files
committed
Applied automated CS fixes
1 parent 068ae33 commit 1f6df0e

8 files changed

+25
-27
lines changed

bin/console.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ static function (int $errorCode, string $message = '', string $file = '', int $l
6363
E_STRICT | E_NOTICE | E_WARNING,
6464
);
6565

66-
$variables = EnvironmentVariables::fromEnvironment(new ImportGpgKeyFromStringViaTemporaryFile());
67-
$logger = new Logger(
66+
$variables = EnvironmentVariables::fromEnvironment(new ImportGpgKeyFromStringViaTemporaryFile());
67+
$logger = new Logger(
6868
'automatic-releases',
6969
[new StreamHandler(STDERR, $variables->logLevel())],
7070
[
7171
new ConvertLogContextHttpRequestsIntoStrings(),
7272
new ConvertLogContextHttpResponsesIntoStrings(),
73-
]
73+
],
7474
);
7575
$loadEvent = new LoadCurrentGithubEventFromGithubActionPath($variables);
7676
$fetch = new FetchAndSetCurrentUserByReplacingCurrentOriginRemote($variables);

src/HttpClient/LoggingHttpClient.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ public function sendRequest(RequestInterface $request): ResponseInterface
2727
[
2828
'request' => $request,
2929
'response' => $response,
30-
]
30+
],
3131
);
3232

3333
return $response;
3434
}
35-
}
35+
}

src/Monolog/ConvertLogContextHttpRequestsIntoStrings.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Monolog\Processor\ProcessorInterface;
99
use Psr\Http\Message\RequestInterface;
1010

11+
use function array_map;
12+
1113
/** @internal */
1214
final class ConvertLogContextHttpRequestsIntoStrings implements ProcessorInterface
1315
{
@@ -31,7 +33,7 @@ public function __invoke(LogRecord $record): LogRecord
3133
->__toString();
3234
}, $record->context),
3335
$record->extra,
34-
$record->formatted
36+
$record->formatted,
3537
);
3638
}
37-
}
39+
}

src/Monolog/ConvertLogContextHttpResponsesIntoStrings.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
use Monolog\Processor\ProcessorInterface;
99
use Psr\Http\Message\ResponseInterface;
1010

11+
use function array_map;
12+
1113
/** @internal */
1214
final class ConvertLogContextHttpResponsesIntoStrings implements ProcessorInterface
1315
{
@@ -31,7 +33,7 @@ public function __invoke(LogRecord $record): LogRecord
3133
. '"';
3234
}, $record->context),
3335
$record->extra,
34-
$record->formatted
36+
$record->formatted,
3537
);
3638
}
37-
}
39+
}

test/unit/HttpClient/LoggingHttpClientTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,9 @@
66

77
use Http\Discovery\Psr17FactoryDiscovery;
88
use Laminas\AutomaticReleases\HttpClient\LoggingHttpClient;
9-
use Monolog\Handler\StreamHandler;
10-
use Monolog\Logger;
119
use PHPUnit\Framework\TestCase;
1210
use Psr\Http\Client\ClientInterface;
1311
use Psr\Log\LoggerInterface;
14-
use function fopen;
1512

1613
/** @covers \Laminas\AutomaticReleases\HttpClient\LoggingHttpClient */
1714
final class LoggingHttpClientTest extends TestCase
@@ -48,7 +45,7 @@ public function testWillLogRequestAndResponse(): void
4845
self::assertSame(
4946
$response,
5047
(new LoggingHttpClient($next, $logger))
51-
->sendRequest($request)
48+
->sendRequest($request),
5249
);
5350
}
5451
}

test/unit/Monolog/ConvertLogContextHttpRequestsIntoStringsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testWillScrubSensitiveRequestInformation(): void
3838
'foo' => 'bar',
3939
'plain request' => 'GET http://example.com/foo',
4040
'sensitive request' => 'POST https://example.com/foo?bar=baz',
41-
]
41+
],
4242
),
4343
(new ConvertLogContextHttpRequestsIntoStrings())(new LogRecord(
4444
$date,
@@ -49,8 +49,8 @@ public function testWillScrubSensitiveRequestInformation(): void
4949
'foo' => 'bar',
5050
'plain request' => $plainRequest,
5151
'sensitive request' => $sensitiveRequest,
52-
]
53-
))
52+
],
53+
)),
5454
);
5555
}
5656
}

test/unit/Monolog/ConvertLogContextHttpResponsesIntoStringsTest.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,10 @@
66

77
use DateTimeImmutable;
88
use Http\Discovery\Psr17FactoryDiscovery;
9-
use Laminas\AutomaticReleases\HttpClient\LoggingHttpClient;
10-
use Laminas\AutomaticReleases\Monolog\ConvertLogContextHttpRequestsIntoStrings;
119
use Laminas\AutomaticReleases\Monolog\ConvertLogContextHttpResponsesIntoStrings;
12-
use Monolog\Handler\StreamHandler;
1310
use Monolog\Level;
14-
use Monolog\Logger;
1511
use Monolog\LogRecord;
1612
use PHPUnit\Framework\TestCase;
17-
use Psr\Http\Client\ClientInterface;
18-
use function fopen;
1913

2014
/** @covers \Laminas\AutomaticReleases\Monolog\ConvertLogContextHttpResponsesIntoStrings */
2115
final class ConvertLogContextHttpResponsesIntoStringsTest extends TestCase
@@ -44,7 +38,7 @@ public function testWillScrubSensitiveRequestInformation(): void
4438
'foo' => 'bar',
4539
'plain response' => '401 ""',
4640
'sensitive response' => '403 "this should be printed"',
47-
]
41+
],
4842
),
4943
(new ConvertLogContextHttpResponsesIntoStrings())(new LogRecord(
5044
$date,
@@ -55,8 +49,8 @@ public function testWillScrubSensitiveRequestInformation(): void
5549
'foo' => 'bar',
5650
'plain response' => $plainResponse,
5751
'sensitive response' => $sensitiveResponse,
58-
]
59-
))
52+
],
53+
)),
6054
);
6155
}
6256
}

test/unit/Monolog/VerifyLoggingIntegrationTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
use Monolog\Handler\StreamHandler;
1111
use Monolog\Logger;
1212
use PHPUnit\Framework\TestCase;
13+
1314
use function fopen;
15+
use function rewind;
16+
use function stream_get_contents;
1417

1518
/**
1619
* Small integration test to ensure future compatibility with monolog in our setup.
@@ -37,7 +40,7 @@ public function testLoggedRequestAndResponseBodyPartsDoNotContainSecretsAndPostD
3740
[
3841
new ConvertLogContextHttpRequestsIntoStrings(),
3942
new ConvertLogContextHttpResponsesIntoStrings(),
40-
]
43+
],
4144
);
4245

4346
$logger->debug('message', ['request' => $request, 'response' => $response]);
@@ -47,7 +50,7 @@ public function testLoggedRequestAndResponseBodyPartsDoNotContainSecretsAndPostD
4750
self::assertStringContainsString(
4851
': message {"request":"GET http://example.com/foo/bar","response":"204 \"hello world\""} []',
4952
stream_get_contents($stream),
50-
'Request and response contents have been serialized into the final log message'
53+
'Request and response contents have been serialized into the final log message',
5154
);
5255
}
5356
}

0 commit comments

Comments
 (0)