Skip to content

Commit

Permalink
use api_type to switch parameters for authentications methods
Browse files Browse the repository at this point in the history
  • Loading branch information
JoMessina committed Nov 22, 2023
1 parent f22f4a7 commit 0e7e2f2
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/Builder/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,33 @@ private function getFactoryMethod(): string
private function getFactoryArguments(): array

Check failure on line 167 in src/Builder/Client.php

View workflow job for this annotation

GitHub Actions / phpstan-7

Method Kiboko\Plugin\Sylius\Builder\Client::getFactoryArguments() return type has no value type specified in iterable type array.

Check failure on line 167 in src/Builder/Client.php

View workflow job for this annotation

GitHub Actions / phpstan-8

Method Kiboko\Plugin\Sylius\Builder\Client::getFactoryArguments() return type has no value type specified in iterable type array.
{
if (null !== $this->password) {
if ($this->apiType === ApiType::LEGACY->value) {
return [
$this->clientId,
$this->secret,
$this->username,
$this->password,
];
}

return [
$this->clientId,
$this->secret,
$this->username,
$this->password,
];
}

if (null !== $this->refreshToken) {
if ($this->apiType === ApiType::LEGACY->value) {
return [
$this->clientId,
$this->secret,
$this->token,
$this->refreshToken,
];
}

return [
$this->clientId,
$this->secret,
$this->token,
$this->refreshToken,
];
}

Expand Down

0 comments on commit 0e7e2f2

Please sign in to comment.