Skip to content

Commit 67a9e55

Browse files
committed
clean up
1 parent 7df84a2 commit 67a9e55

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/Factories/ApiFactory.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,10 @@ public function run(?string $clientType = null): ClientInterface
7777
$this->initialize();
7878
}
7979

80-
switch (strtolower($clientType)) {
81-
case ClientTypes::GUZZLE->value:
82-
return new Client($this->clientConfig);
83-
case ClientTypes::SYMFONY->value:
84-
$symfonyClient = HttpClient::create($this->clientConfig);
85-
return new Psr18Client($symfonyClient);
86-
default:
87-
throw new InvalidArgumentException("Unsupported client type: {$clientType}");
88-
}
80+
return match (strtolower($clientType)) {
81+
ClientTypes::GUZZLE->value => new Client($this->clientConfig),
82+
ClientTypes::SYMFONY->value => new Psr18Client(HttpClient::create($this->clientConfig)),
83+
default => throw new InvalidArgumentException("Unsupported client type: {$clientType}")
84+
};
8985
}
9086
}

0 commit comments

Comments
 (0)