Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

phpstan: added some return statements to match parent class or interface #2574

Merged
merged 4 commits into from
Sep 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 0 additions & 135 deletions .github/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Adminhtml/Block/Report/Sales/Coupons/Grid.php

-
message: "#^Method Mage_Adminhtml_Block_Review_Grid_Renderer_Type\\:\\:render\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php

-
message: "#^Undefined variable\\: \\$info$#"
count: 1
Expand Down Expand Up @@ -500,11 +495,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Number.php

-
message: "#^Method Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Options\\:\\:render\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Options.php

-
message: "#^Call to an undefined method Mage_Adminhtml_Block_Widget_Tab_Interface\\:\\:getSkipGenerateContent\\(\\)\\.$#"
count: 1
Expand All @@ -530,16 +520,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Adminhtml/Block/Widget/Tabs.php

-
message: "#^Method Mage_Adminhtml_Helper_Catalog_Product_Composite\\:\\:renderConfigureResult\\(\\) should return \\$this\\(Mage_Adminhtml_Helper_Catalog_Product_Composite\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php

-
message: "#^Method Mage_Adminhtml_Helper_Catalog_Product_Composite\\:\\:renderUpdateResult\\(\\) should return \\$this\\(Mage_Adminhtml_Helper_Catalog_Product_Composite\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php

-
message: "#^Method Mage_Adminhtml_Model_Config\\:\\:getSection\\(\\) should return Varien_Simplexml_Element but return statement is missing\\.$#"
count: 1
Expand Down Expand Up @@ -585,16 +565,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Catalog/Search/Type.php

-
message: "#^Method Mage_Adminhtml_Model_System_Config_Backend_Encrypted\\:\\:_afterLoad\\(\\) should return \\$this\\(Mage_Adminhtml_Model_System_Config_Backend_Encrypted\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Encrypted.php

-
message: "#^Method Mage_Adminhtml_Model_System_Config_Backend_Serialized\\:\\:_afterLoad\\(\\) should return \\$this\\(Mage_Adminhtml_Model_System_Config_Backend_Serialized\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Serialized.php

-
message: "#^Comparison operation \"\\=\\=\" between \\(Varien_Simplexml_Element\\|null\\) and 1 results in an error\\.$#"
count: 1
Expand Down Expand Up @@ -635,11 +605,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Adminhtml/controllers/Catalog/SearchController.php

-
message: "#^Method Mage_Adminhtml_CustomerController\\:\\:cartAction\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/controllers/CustomerController.php

-
message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -1250,11 +1215,6 @@ parameters:
count: 2
path: ../app/code/core/Mage/Catalog/Model/Api/Resource.php

-
message: "#^Method Mage_Catalog_Model_Api2_Product_Image_Rest_Admin_V1\\:\\:_create\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Catalog/Model/Api2/Product/Image/Rest/Admin/V1.php

-
message: "#^Call to an undefined method Mage_Core_Model_Abstract\\:\\:toOptionArray\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -1395,16 +1355,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php

-
message: "#^Method Mage_Catalog_Model_Product_Attribute_Backend_Media\\:\\:afterLoad\\(\\) should return \\$this\\(Mage_Catalog_Model_Product_Attribute_Backend_Media\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php

-
message: "#^Method Mage_Catalog_Model_Product_Attribute_Backend_Recurring\\:\\:beforeSave\\(\\) should return \\$this\\(Mage_Catalog_Model_Product_Attribute_Backend_Recurring\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Recurring.php

-
message: "#^Cannot call method getBackend\\(\\) on bool\\|Mage_Catalog_Model_Resource_Attribute\\.$#"
count: 11
Expand Down Expand Up @@ -1450,11 +1400,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php

-
message: "#^Method Mage_Catalog_Model_Product_Option_Type_File\\:\\:getCustomizedView\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php

-
message: "#^Variable \\$value in isset\\(\\) always exists and is not nullable\\.$#"
count: 1
Expand Down Expand Up @@ -1755,11 +1700,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/CatalogInventory/Model/Stock/Item.php

-
message: "#^Method Mage_CatalogInventory_Model_System_Config_Backend_Minsaleqty\\:\\:_afterLoad\\(\\) should return \\$this\\(Mage_CatalogInventory_Model_System_Config_Backend_Minsaleqty\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php

-
message: "#^Variable \\$gId might not be defined\\.$#"
count: 1
Expand Down Expand Up @@ -1820,11 +1760,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Checkout/Block/Cart/Item/Renderer/Configurable.php

-
message: "#^Method Mage_Checkout_Block_Onepage_Payment_Methods\\:\\:getMethodLabelAfterHtml\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Checkout/Block/Onepage/Payment/Methods.php

-
message: "#^Call to an undefined method Mage_Sales_Model_Service_Order\\:\\:register\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -1985,11 +1920,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Core/Model/Config.php

-
message: "#^Method Mage_Core_Model_Config_Data\\:\\:afterLoad\\(\\) should return \\$this\\(Mage_Core_Model_Config_Data\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Core/Model/Config/Data.php

-
message: "#^Binary operation \"\\+\" between string and string results in an error\\.$#"
count: 1
Expand Down Expand Up @@ -2115,11 +2045,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Core/functions.php

-
message: "#^Function mageDebugBacktrace\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Core/functions.php

-
message: "#^Variable \\$arguments might not be defined\\.$#"
count: 1
Expand Down Expand Up @@ -2180,11 +2105,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Customer/Model/Customer.php

-
message: "#^Method Mage_Customer_Model_Customer_Attribute_Backend_Password\\:\\:beforeSave\\(\\) should return \\$this\\(Mage_Customer_Model_Customer_Attribute_Backend_Password\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Customer/Model/Customer/Attribute/Backend/Password.php

-
message: "#^Cannot call method addAttributeToSelect\\(\\) on Mage_Core_Model_Resource_Db_Collection_Abstract\\|false\\.$#"
count: 1
Expand Down Expand Up @@ -2580,16 +2500,6 @@ parameters:
count: 2
path: ../app/code/core/Mage/Eav/Model/Resource/Form/Type.php

-
message: "#^Method Mage_GiftMessage_Model_Entity_Attribute_Backend_Boolean_Config\\:\\:afterLoad\\(\\) should return \\$this\\(Mage_GiftMessage_Model_Entity_Attribute_Backend_Boolean_Config\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Backend/Boolean/Config.php

-
message: "#^Method Mage_GiftMessage_Model_Entity_Attribute_Backend_Boolean_Config\\:\\:beforeSave\\(\\) should return \\$this\\(Mage_GiftMessage_Model_Entity_Attribute_Backend_Boolean_Config\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/GiftMessage/Model/Entity/Attribute/Backend/Boolean/Config.php

-
message: "#^Call to an undefined method Mage_Eav_Model_Entity_Abstract\\:\\:setGiftMessageId\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -2770,11 +2680,6 @@ parameters:
count: 3
path: ../app/code/core/Mage/ImportExport/Model/Import/Entity/Product/Type/Grouped.php

-
message: "#^Method Mage_Index_Block_Adminhtml_Process_Edit\\:\\:getHeaderText\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Index/Block/Adminhtml/Process/Edit.php

-
message: "#^Method Mage_Core_Model_Resource\\:\\:getConnection\\(\\) invoked with 2 parameters, 1 required\\.$#"
count: 1
Expand Down Expand Up @@ -2910,11 +2815,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Paygate/controllers/Authorizenet/PaymentController.php

-
message: "#^Method Mage_Payment_Block_Catalog_Product_View_Profile\\:\\:getDateHtml\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Payment/Block/Catalog/Product/View/Profile.php

-
message: "#^Call to an undefined method Mage_Core_Model_Abstract\\:\\:isAvailable\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -3240,16 +3140,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Paypal/Model/Observer.php

-
message: "#^Method Mage_Paypal_Model_Payflowlink\\:\\:_getTrxTokenType\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Paypal/Model/Payflowlink.php

-
message: "#^Method Mage_Paypal_Model_Payflowlink\\:\\:initialize\\(\\) should return \\$this\\(Mage_Paypal_Model_Payflowlink\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Paypal/Model/Payflowlink.php

-
message: "#^Variable \\$order in empty\\(\\) always exists and is not falsy\\.$#"
count: 1
Expand All @@ -3275,11 +3165,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Paypal/Model/Payflowpro.php

-
message: "#^Method Mage_Paypal_Model_Payflowpro\\:\\:getConfigPaymentAction\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Paypal/Model/Payflowpro.php

-
message: "#^Variable \\$order in empty\\(\\) always exists and is not falsy\\.$#"
count: 1
Expand Down Expand Up @@ -3310,11 +3195,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Paypal/Model/Standard.php

-
message: "#^Method Mage_Paypal_Model_System_Config_Backend_MerchantCountry\\:\\:_afterLoad\\(\\) should return \\$this\\(Mage_Paypal_Model_System_Config_Backend_MerchantCountry\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Paypal/Model/System/Config/Backend/MerchantCountry.php

-
message: "#^Method Varien_Data_Collection\\:\\:toOptionArray\\(\\) invoked with 1 parameter, 0 required\\.$#"
count: 1
Expand Down Expand Up @@ -3500,11 +3380,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Sales/Block/Order/Details.php

-
message: "#^Method Mage_Sales_Model_Billing_Agreement\\:\\:getStatusLabel\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Sales/Model/Billing/Agreement.php

-
message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -3640,11 +3515,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Sales/Model/Resource/Order/Address.php

-
message: "#^Method Mage_Sales_Model_Resource_Order_Invoice_Collection\\:\\:_afterLoad\\(\\) should return \\$this\\(Mage_Sales_Model_Resource_Order_Invoice_Collection\\) but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Sales/Model/Resource/Order/Invoice/Collection.php

-
message: "#^Call to an undefined method Mage_Core_Model_Abstract\\:\\:isFailsafe\\(\\)\\.$#"
count: 1
Expand Down Expand Up @@ -3940,11 +3810,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Widget/Model/Widget/Instance.php

-
message: "#^Method Mage_Wishlist_Block_Customer_Wishlist_Item_Column\\:\\:_beforeChildToHtml\\(\\) should return string but return statement is missing\\.$#"
count: 1
path: ../app/code/core/Mage/Wishlist/Block/Customer/Wishlist/Item/Column.php

-
message: "#^Method Mage_Wishlist_Model_Item\\:\\:save\\(\\) should return \\$this\\(Mage_Wishlist_Model_Item\\) but return statement is missing\\.$#"
count: 1
Expand Down
14 changes: 10 additions & 4 deletions app/code/core/Mage/Adminhtml/Block/Review/Grid/Renderer/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,23 @@
*/
class Mage_Adminhtml_Block_Review_Grid_Renderer_Type extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
{
/**
* @param Mage_Catalog_Model_Product $row
* @return string
*/
public function render(Varien_Object $row)
{
if (is_null($row->getCustomerId())) {
if ($row->getStoreId() == Mage_Core_Model_App::ADMIN_STORE_ID) {
return Mage::helper('review')->__('Administrator');
} else {
return Mage::helper('review')->__('Guest');
}
} elseif ($row->getCustomerId() > 0) {
return Mage::helper('review')->__('Guest');
}

if ($row->getCustomerId() > 0) {
return Mage::helper('review')->__('Customer');
}
//return ($row->getCustomerId() ? Mage::helper('review')->__('Customer') : Mage::helper('review')->__('Guest'));

return '';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,6 @@ public function render(Varien_Object $row)
return $this->escapeHtml($value);
}
}
return '';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public function renderUpdateResult($controller, Varien_Object $updateResult)

$this->_initUpdateResultLayout($controller);
$controller->renderLayout();
return $this;
}

/**
Expand Down Expand Up @@ -142,5 +143,6 @@ public function renderConfigureResult($controller, Varien_Object $configureResul

$this->_initConfigureResultLayout($controller, $isOk, $productType);
$controller->renderLayout();
return $this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ class Mage_Adminhtml_Model_System_Config_Backend_Encrypted extends Mage_Core_Mod
{
/**
* Decrypt value after loading
*
*/
protected function _afterLoad()
{
$value = (string)$this->getValue();
if (!empty($value) && ($decrypted = Mage::helper('core')->decrypt($value))) {
$this->setValue($decrypted);
}
return $this;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
*/
class Mage_Adminhtml_Model_System_Config_Backend_Serialized extends Mage_Core_Model_Config_Data
{
/**
* @return $this
*/
protected function _afterLoad()
{
if (!is_array($this->getValue())) {
Expand All @@ -40,6 +43,7 @@ protected function _afterLoad()
}
$this->setValue($unserializedValue);
}
return $this;
}

/**
Expand Down
Loading