-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from journy-io/updated-api-endpoints
Update methods
- Loading branch information
Showing
6 changed files
with
282 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace JournyIO\SDK; | ||
|
||
use InvalidArgumentException; | ||
|
||
final class AccountIdentified | ||
{ | ||
private $accountId; | ||
private $domain; | ||
|
||
public function __construct(string $accountId = null, string $domain = null) | ||
{ | ||
if (empty($accountId) && empty($domain)) { | ||
throw new InvalidArgumentException("Account ID or domain needs to set or both"); | ||
} | ||
|
||
$this->accountId = $accountId; | ||
$this->domain = $domain; | ||
} | ||
|
||
public static function byAccountId(string $accountId) | ||
{ | ||
return new AccountIdentified($accountId, null); | ||
} | ||
|
||
public static function byDomain(string $domain) | ||
{ | ||
return new AccountIdentified(null, $domain); | ||
} | ||
|
||
public function getAccountId() | ||
{ | ||
return $this->accountId; | ||
} | ||
|
||
public function getDomain() | ||
{ | ||
return $this->domain; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.