Skip to content
Merged
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
29 changes: 17 additions & 12 deletions src/Model/Token/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,46 +41,46 @@ public function validate()
return true;
}

/** @var string $networkAddress */
/** @var string|null $networkAddress */
protected $networkAddress;

/** @var string $countryCode */
/** @var string|null $countryCode */
protected $countryCode;

/**
* @param string $networkAddress
* @param string|null $networkAddress
* @return Customer
*/
public function setNetworkAddress(string $networkAddress): Customer
public function setNetworkAddress(?string $networkAddress): Customer
{
$this->networkAddress = $networkAddress;

return $this;
}

/**
* @return string
* @return string|null
*/
public function getNetworkAddress(): string
public function getNetworkAddress(): ?string
{
return $this->networkAddress;
}

/**
* @param string $countryCode
* @param string|null $countryCode
* @return Customer
*/
public function setCountryCode(string $countryCode): Customer
public function setCountryCode(?string $countryCode): Customer
{
$this->countryCode = $countryCode;

return $this;
}

/**
* @return string
* @return string|null
*/
public function getCountryCode(): string
public function getCountryCode(): ?string
{
return $this->countryCode;
}
Expand All @@ -103,8 +103,13 @@ public function jsonSerialize(): array
*/
public function loadFromStdClass(\stdClass $customer): Customer
{
$this->setNetworkAddress($customer->network_address);
$this->setCountryCode($customer->country_code);
if (isset($customer->network_address)) {
$this->setNetworkAddress($customer->network_address);
}

if (isset($customer->country_code)) {
$this->setCountryCode($customer->country_code);
}

return $this;
}
Expand Down