Skip to content

Commit 86bdeae

Browse files
committed
💄 Multiline constructor parameters
1 parent 0725be7 commit 86bdeae

File tree

6 files changed

+29
-12
lines changed

6 files changed

+29
-12
lines changed

src/ClientFactory/CurlFactory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
*/
1414
class CurlFactory implements ClientFactory
1515
{
16-
public function __construct(private readonly ResponseFactoryInterface $responseFactory, private readonly StreamFactoryInterface $streamFactory)
17-
{
16+
public function __construct(
17+
private readonly ResponseFactoryInterface $responseFactory,
18+
private readonly StreamFactoryInterface $streamFactory
19+
) {
1820
}
1921

2022
public function createClient(array $config = [])

src/ClientFactory/SymfonyFactory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414
*/
1515
class SymfonyFactory implements ClientFactory
1616
{
17-
public function __construct(private readonly ResponseFactoryInterface $responseFactory, private readonly StreamFactoryInterface $streamFactory)
18-
{
17+
public function __construct(
18+
private readonly ResponseFactoryInterface $responseFactory,
19+
private readonly StreamFactoryInterface $streamFactory
20+
) {
1921
}
2022

2123
public function createClient(array $config = [])

src/Collector/Formatter.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222
*/
2323
class Formatter implements MessageFormatter
2424
{
25-
public function __construct(private readonly MessageFormatter $formatter, private readonly MessageFormatter $curlFormatter)
26-
{
25+
public function __construct(
26+
private readonly MessageFormatter $formatter,
27+
private readonly MessageFormatter $curlFormatter,
28+
) {
2729
}
2830

2931
/**

src/Collector/PluginClientFactory.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@
2020
*/
2121
final class PluginClientFactory
2222
{
23-
public function __construct(private readonly Collector $collector, private readonly Formatter $formatter, private readonly Stopwatch $stopwatch)
24-
{
23+
public function __construct(
24+
private readonly Collector $collector,
25+
private readonly Formatter $formatter,
26+
private readonly Stopwatch $stopwatch
27+
) {
2528
}
2629

2730
/**

src/Collector/ProfileClient.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,12 @@ class ProfileClient implements ClientInterface, HttpAsyncClient
3636
* @param ClientInterface|HttpAsyncClient $client The client to profile. Client must implement HttpClient or
3737
* HttpAsyncClient interface.
3838
*/
39-
public function __construct($client, private readonly Collector $collector, private readonly Formatter $formatter, private readonly Stopwatch $stopwatch)
40-
{
39+
public function __construct(
40+
$client,
41+
private readonly Collector $collector,
42+
private readonly Formatter $formatter,
43+
private readonly Stopwatch $stopwatch
44+
) {
4145
if (!($client instanceof ClientInterface && $client instanceof HttpAsyncClient)) {
4246
$client = new FlexibleHttpClient($client);
4347
}

src/Collector/ProfileClientFactory.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,12 @@ class ProfileClientFactory implements ClientFactory
2727
/**
2828
* @param ClientFactory|callable $factory
2929
*/
30-
public function __construct($factory, private readonly Collector $collector, private readonly Formatter $formatter, private readonly Stopwatch $stopwatch)
31-
{
30+
public function __construct(
31+
$factory,
32+
private readonly Collector $collector,
33+
private readonly Formatter $formatter,
34+
private readonly Stopwatch $stopwatch
35+
) {
3236
if (!$factory instanceof ClientFactory && !is_callable($factory)) {
3337
throw new \RuntimeException(sprintf('First argument to ProfileClientFactory::__construct must be a "%s" or a callable.', ClientFactory::class));
3438
}

0 commit comments

Comments
 (0)