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: some fixes #4346

Merged
merged 5 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from 3 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
590 changes: 10 additions & 580 deletions .phpstan.dist.baseline.neon

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions app/code/core/Mage/Payment/Model/Method/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,13 @@ public function getInfoBlockType()
/**
* Retrieve payment information model object
*
* @return Mage_Payment_Model_Info
* @return Mage_Sales_Model_Order_Payment|Mage_Sales_Model_Quote_Payment
*/
public function getInfoInstance()
{
/** @var Mage_Sales_Model_Order_Payment|Mage_Sales_Model_Quote_Payment $instance */
$instance = $this->getData('info_instance');
if (!($instance instanceof Mage_Payment_Model_Info)) {
if (!$instance instanceof Mage_Payment_Model_Info) {
Mage::throwException(Mage::helper('payment')->__('Cannot retrieve the payment information object instance.'));
}
return $instance;
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Paypal/Model/Payflowlink.php
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,6 @@ protected function _getOrderFromResponse()
/**
* Build request for getting token
*
* @param Mage_Sales_Model_Order_Payment|Mage_Payment_Model_Info $payment
* @return Varien_Object
sreichel marked this conversation as resolved.
Show resolved Hide resolved
*/
protected function _buildTokenRequest(Mage_Sales_Model_Order_Payment $payment)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ interface Mage_Reports_Model_Resource_Helper_Interface
* @param string $mainTable
* @param array $data
* @param mixed $matchFields
* @return string
* @return int
*/
public function mergeVisitorProductIndex($mainTable, $data, $matchFields);

Expand Down
10 changes: 5 additions & 5 deletions app/code/core/Mage/Sales/Model/Order/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ public function place()
*
* TODO: eliminate logic duplication with registerCaptureNotification()
*
* @param Mage_Sales_Model_Order_Invoice $invoice
* @param Mage_Sales_Model_Order_Invoice|null $invoice
* @return $this
* @throws Mage_Core_Exception
*/
Expand Down Expand Up @@ -1251,7 +1251,7 @@ protected function _void($isOnline, $amount = null, $gatewayCallback = 'void')
* @param string $type
* @param Mage_Sales_Model_Abstract $salesDocument
* @param bool $failsafe
* @return null|Mage_Sales_Model_Order_Payment_Transaction
* @return null|Mage_Sales_Model_Order_Payment_Transaction|void
*/
protected function _addTransaction($type, $salesDocument = null, $failsafe = false)
{
Expand Down Expand Up @@ -1413,7 +1413,7 @@ protected function _isTransactionExists($txnId = null)
/**
* Append transaction ID (if any) message to the specified message
*
* @param Mage_Sales_Model_Order_Payment_Transaction|null $transaction
* @param Mage_Sales_Model_Order_Payment_Transaction|string|null $transaction
* @param string $message
* @return string
*/
Expand Down Expand Up @@ -1479,7 +1479,7 @@ protected function _formatPrice($amount, $currency = null)

/**
* Find one transaction by ID or type
* @param string $txnId
* @param string|false|null $txnId
* @param string|false $txnType
* @return Mage_Sales_Model_Order_Payment_Transaction|false
*/
Expand Down Expand Up @@ -1518,7 +1518,7 @@ protected function _lookupTransaction($txnId, $txnType = false)

/**
* Find one transaction by ID or type
* @param string $txnId
* @param string|false $txnId
* @param string|false $txnType
* @return Mage_Sales_Model_Order_Payment_Transaction|false
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/SalesRule/Model/Quote/Discount.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ protected function _aggregateItemDiscount($item)
/**
* Add discount total information to address
*
* @return $this
* @return $this|array
kiatng marked this conversation as resolved.
Show resolved Hide resolved
*/
public function fetch(Mage_Sales_Model_Quote_Address $address)
{
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Weee/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public function getAmount($product, $shipping = null, $billing = null, $website
/**
* Returns display type for price accordingly to current zone
*
* @param Mage_Catalog_Model_Product $product
* @param mixed $product
* @param array|int|null $compareTo
* @param string $zone
* @param Mage_Core_Model_Store $store
Expand Down Expand Up @@ -220,7 +220,7 @@ public function typeOfDisplay($product, $compareTo = null, $zone = null, $store
* @param Mage_Catalog_Model_Product $product
* @param null|false|Varien_Object $shipping
* @param null|false|Varien_Object $billing
* @param int|Mage_Core_Model_Website $website
* @param int|Mage_Core_Model_Website|null|string|true $website
* @param bool $calculateTaxes
* @return array
*/
Expand Down Expand Up @@ -300,7 +300,7 @@ public function getProductWeeeAttributesForDisplay($product)
* @param Mage_Catalog_Model_Product $product
* @param null|false|Varien_Object $shipping Shipping Address
* @param null|false|Varien_Object $billing Billing Address
* @param null|int $website
* @param int|Mage_Core_Model_Website|null|string|true $website
* @param mixed $calculateTaxes
* @return array
*/
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Weee/Model/Tax.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function getWeeeTaxAttributeCodes($forceEnabled = false)
* @param Mage_Catalog_Model_Product $product
* @param Mage_Sales_Model_Quote_Address $shipping
* @param Mage_Sales_Model_Quote_Address $billing
* @param int|Mage_Core_Model_Website $website
* @param int|Mage_Core_Model_Website|null|string|true $website
* @param bool $calculateTax
* @param bool $ignoreDiscount
* @return array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Template $this */
?>
<script type="text/javascript">
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Permissions_Tab_Rolesusers $this */
?>
<h4 class="icon-head head-edit-form fieldset-legend"><?php echo $this->__('Role Users') ?></h4>
<?php echo $this->_getGridHtml() ?>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Template $this */
?>
<script type="text/javascript">
<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Report_Refresh_Statistics $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Sales_Order_Shipment_Packaging $this */
?>

<div id="packed_window" style="display:none;" class="packed-window">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Sales_Order_Shipment_Packaging $this */
?>
<?php
$shippingMethod = $this->getShipment()->getOrder()->getShippingMethod();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_System_Design_Edit $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_System_Design $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2023 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_System_Email_Template_Edit $this */
?>
<div class="content-header">
<h3 class="icon-head head-system-email-template"><?php echo $this->getHeaderText() ?></h3>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_System_Email_Template $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Core_Block_Template $this */
?>
<?php echo $this->getChildHtml('content') ?>
<?php echo $this->getChildHtml('profiler') ?>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Tag_Edit $this */
?>
<?php echo $this->getFormInitScripts() ?>
<div class="content-header">
Expand Down
2 changes: 2 additions & 0 deletions app/design/adminhtml/default/default/template/tag/index.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Tag_Pending $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Tax_Rate_ImportExport $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Tax_Rate_Form $this */
?>
<div class="entry-edit">
<?php echo $this->getFormHtml() ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Tax_Rate_Title $this */
?>
<?php /* <table class="dynamic-grid" cellspacing="0" id="tax-rate-titles-table"> */ ?>
<tr class="dynamic-grid">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/**
* @var Mage_Adminhtml_Block_Tax_Rate_Toolbar_Add $this
* @var string $header
*/
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/**
* @var Mage_Adminhtml_Block_Tax_Rate_Toolbar_Save $this
* @var string $header
* @var Mage_Adminhtml_Block_Tax_Rate_Form $form
*/
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Tax_Rule_Edit_Form $this */
?>
<div class="entry-edit">
<?php echo $this->getFormHtml();?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php

/**
* Template for MAP popup
*
* @var Mage_Core_Block_Template $this
*/
?>
<?php if (Mage::helper('catalog')->isMsrpEnabled()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Catalog_Block_Product_List_Related $this */
?>
<?php if($this->getItems()->getSize()): ?>
<div class="block block-related">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Catalog_Block_Product_List_Upsell $this */
?>
<?php if(count($this->getItemCollection()->getItems())): ?>
<div class="box-collateral box-up-sell">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Catalog_Block_Product_View $this */
?>

<?php $_product = $this->getProduct(); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Catalog_Block_Product_View $this */
?>
<?php $_product = $this->getProduct(); ?>
<?php $buttonTitle = $this->__('Add to Cart'); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
?>
<?php
/**
* @see Mage_Catalog_Block_Seo_Sitemap_
* @var Mage_Catalog_Block_Seo_Sitemap_ $this
* @see Mage_Catalog_Block_Seo_Sitemap_Product
* @var Mage_Catalog_Block_Seo_Sitemap_Product $this
*/
?>
<?php $_items = $this->getCollection(); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Page_Block_Template_Container $this */
?>
<div class="page-sitemap">
<div class="page-title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
?>
<?php
/**
* @see Mage_Catalog_Block_Seo_Sitemap_
* @var Mage_Catalog_Block_Seo_Sitemap_ $this
* @see Mage_Catalog_Block_Seo_Sitemap_Tree_Category
* @var Mage_Catalog_Block_Seo_Sitemap_Tree_Category $this
*/
?>
<?php $_items = $this->getCollection(); ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_CatalogSearch_Block_Advanced_Result $this */
?>
<div class="page-title">
<h1><?php echo $this->__('Catalog Advanced Search') ?></h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
/** @var Mage_Core_Block_Template $this */
/* @var $catalogSearchHelper Mage_CatalogSearch_Helper_Data */
/** @var Mage_CatalogSearch_Helper_Data $catalogSearchHelper */
$catalogSearchHelper = $this->helper('catalogsearch');
?>
<form id="search_mini_form" action="<?php echo $catalogSearchHelper->getResultUrl() ?>" method="get">
Expand Down
Loading