Skip to content

Commit

Permalink
[ACCOUNT-2447] fix: unset values with empty string instead of null (#422
Browse files Browse the repository at this point in the history
)

* fix: unset values with empty string instead of null
  • Loading branch information
hschoenenberger authored Jul 23, 2024
1 parent e88dc14 commit 65d534a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/Account/LinkShop.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ public function __construct(
*/
public function delete()
{
$this->setShopUuid(null);
$this->setEmployeeId(null);
$this->setOwnerUuid(null);
$this->setOwnerEmail(null);
$this->setUnlinkedOnError(null);
$this->setShopUuid('');
$this->setEmployeeId('');
$this->setOwnerUuid('');
$this->setOwnerEmail('');
$this->setUnlinkedOnError('');
}

/**
Expand All @@ -62,10 +62,10 @@ public function delete()
public function update(Dto\LinkShop $payload)
{
$this->setShopUuid($payload->uid);
$this->setEmployeeId((int) $payload->employeeId ?: null);
$this->setEmployeeId((int) $payload->employeeId ?: '');
$this->setOwnerUuid($payload->ownerUid);
$this->setOwnerEmail($payload->ownerEmail);
$this->setUnlinkedOnError(null);
$this->setUnlinkedOnError('');
}

/**
Expand Down Expand Up @@ -101,7 +101,7 @@ public function getShopUuid()
}

/**
* @param string|null $uuid
* @param string $uuid
*
* @return void
*/
Expand All @@ -111,15 +111,15 @@ public function setShopUuid($uuid)
}

/**
* @return int|null
* @return int
*/
public function getEmployeeId()
{
return (int) $this->configuration->getEmployeeId();
}

/**
* @param int|null $employeeId
* @param int|string $employeeId
*
* @return void
*/
Expand All @@ -137,7 +137,7 @@ public function getOwnerUuid()
}

/**
* @param string|null $uuid
* @param string $uuid
*
* @return void
*/
Expand All @@ -147,15 +147,15 @@ public function setOwnerUuid($uuid)
}

/**
* @return string|null
* @return string
*/
public function getOwnerEmail()
{
return $this->configuration->getFirebaseEmail();
}

/**
* @param string|null $email
* @param string $email
*
* @return void
*/
Expand All @@ -165,7 +165,7 @@ public function setOwnerEmail($email)
}

/**
* @return string|null
* @return string
*/
public function getUnlinkedOnError()
{
Expand Down
1 change: 1 addition & 0 deletions src/Adapter/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ public function get($key, $default = false, $cached = true)
return $this->getRaw($key, $this->idLang, $this->idShopGroup, $this->idShop, $default);
} else {
// FIXME: idLang ??
// FIXME: beware in single shop context idShop must be set
return $this->getUncached($key, $this->idShopGroup, $this->idShop, $default);
}
}
Expand Down

0 comments on commit 65d534a

Please sign in to comment.