A free open source IT asset/license management system
Reduce ifs
Marcus Mooreca1ef2d85f47
diff --git a/app/Mail/CheckoutAccessoryMail.php b/app/Mail/CheckoutAccessoryMail.phpindex 89340f277f..06bb3116bf 100644--- a/app/Mail/CheckoutAccessoryMail.php+++ b/app/Mail/CheckoutAccessoryMail.php@@ -133,11 +133,7 @@ class CheckoutAccessoryMail extends BaseMailableprivate function getLocation(): ?string{- if ($this->target instanceof User) {- return $this->target->location?->name;- }-- if ($this->target instanceof Asset) {+ if ($this->target instanceof Asset || $this->target instanceof User) {return $this->target->location?->name;}diff --git a/app/Mail/CheckoutAssetMail.php b/app/Mail/CheckoutAssetMail.phpindex 772536df27..7125c362ff 100644--- a/app/Mail/CheckoutAssetMail.php+++ b/app/Mail/CheckoutAssetMail.php@@ -180,11 +180,7 @@ class CheckoutAssetMail extends BaseMailableprivate function getLocation(): ?string{- if ($this->target instanceof User) {- return $this->target->location?->name;- }-- if ($this->target instanceof Asset) {+ if ($this->target instanceof Asset || $this->target instanceof User) {return $this->target->location?->name;}