From 2e2353559333f89dee36b49a550127556bcd8575 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 18 Jan 2022 00:24:11 +0100 Subject: [PATCH] Update CanBeBought.php --- src/CanBeBought.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/CanBeBought.php b/src/CanBeBought.php index 4f305b3..544f36b 100644 --- a/src/CanBeBought.php +++ b/src/CanBeBought.php @@ -19,19 +19,17 @@ trait CanBeBought * * @return string */ - public function getBuyableDescription() + public function getBuyableDescription() : ?string { if (($name = $this->getAttribute('name'))) { return $name; - } - - if (($title = $this->getAttribute('title'))) { + } else if (($title = $this->getAttribute('title'))) { return $title; - } - - if (($description = $this->getAttribute('description'))) { + } else if (($description = $this->getAttribute('description'))) { return $description; - } + } else { + return null; + } } /**