Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/OroApiClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class OroApiClient
*/
protected string $apiEndpoint;

protected string $user;
protected ?string $user = null;

/**
* @var AuthorizationEndpoint
Expand Down Expand Up @@ -194,9 +194,9 @@ public function setUser(string $user): OroApiClient
}

/**
* @return string
* @return null|string
*/
public function getUser(): string
public function getUser(): ?string
{
return $this->user;
}
Expand Down Expand Up @@ -273,7 +273,11 @@ public function performHttpCallAuthorization(string $httpMethod, string $apiMeth
*/
public function performHttpCall(string $httpMethod, string $apiMethod, string $httpBody = null): ?stdClass
{
$url = $this->apiEndpoint . "/" . $this->user . "/" . $apiMethod;
if ($this->user !== null) {
$url = $this->apiEndpoint . "/" . $this->user . "/" . $apiMethod;
} else {
$url = $this->apiEndpoint . "/" . $apiMethod;
}

return $this->performHttpCallToFullUrl($httpMethod, $url, $httpBody);
}
Expand Down