From 3a4a2386aaa1945d3d518cdf73b3a7768b7b860f 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 6de0fe4459fa6..ce1f48c3f2c09 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -1783,7 +1783,7 @@ public function getTracksCollection() /** * Check order invoices availability * - * @return bool + * @return int */ public function hasInvoices() { @@ -1793,7 +1793,7 @@ public function hasInvoices() /** * Check order shipments availability * - * @return bool + * @return int */ public function hasShipments() { @@ -1803,7 +1803,7 @@ public function hasShipments() /** * Check order creditmemos availability * - * @return bool + * @return int */ public function hasCreditmemos() { From fa6e2f1c5ca7da37d9960a30c73254da82b09e3d 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 ce1f48c3f2c09..0038106134b7b 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -1783,31 +1783,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()); } /**