From cf759ece1131aed0aeb8e98877d5082a7c1ed2b2 Mon Sep 17 00:00:00 2001 From: Alex Lyzun Date: Thu, 5 Jul 2018 10:45:22 +0200 Subject: [PATCH 1/2] Fix docBlock for hasInvoices(), hasShipments(), hasCreditmemos() It returns int and not bool --- app/code/Magento/Sales/Model/Order.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index a04f88c7ade1d..380d742211ce6 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -1766,7 +1766,7 @@ public function getTracksCollection() /** * Check order invoices availability * - * @return bool + * @return int */ public function hasInvoices() { @@ -1776,7 +1776,7 @@ public function hasInvoices() /** * Check order shipments availability * - * @return bool + * @return int */ public function hasShipments() { @@ -1786,7 +1786,7 @@ public function hasShipments() /** * Check order creditmemos availability * - * @return bool + * @return int */ public function hasCreditmemos() { From 8e8bcfa924386296baef7f31ffdbc83d81c29439 Mon Sep 17 00:00:00 2001 From: Alex Lyzun Date: Fri, 6 Jul 2018 10:51:04 +0200 Subject: [PATCH 2/2] Change hasInvoices(), hasShipments(), hasCreditmemos() to return boolean value --- app/code/Magento/Sales/Model/Order.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index 380d742211ce6..dc4fd7d75cf77 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -1766,31 +1766,31 @@ public function getTracksCollection() /** * Check order invoices availability * - * @return int + * @return bool */ public function hasInvoices() { - return $this->getInvoiceCollection()->count(); + return boolval($this->getInvoiceCollection()->count()); } /** * Check order shipments availability * - * @return int + * @return bool */ public function hasShipments() { - return $this->getShipmentsCollection()->count(); + return boolval($this->getShipmentsCollection()->count()); } /** * Check order creditmemos availability * - * @return int + * @return bool */ public function hasCreditmemos() { - return $this->getCreditmemosCollection()->count(); + return boolval($this->getCreditmemosCollection()->count()); } /**