Skip to content

Commit 7f8ac27

Browse files
authored
Fix PHP8 Deprecated: Required parameter $A follows optional parameter (OpenMage#1392)
* Fixes PHP8 Deprecated: Required parameter $A follows optional parameter $B * Fixed missing one
1 parent 70248fc commit 7f8ac27

File tree

18 files changed

+102
-94
lines changed

18 files changed

+102
-94
lines changed

app/code/core/Mage/Adminhtml/Block/Widget/Container.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,11 @@ public function removeButton($id)
131131
* Update specified button property
132132
*
133133
* @param string $id
134-
* @param string|null $key
134+
* @param string $key
135135
* @param mixed $data
136136
* @return $this
137137
*/
138-
protected function _updateButton($id, $key=null, $data)
138+
protected function _updateButton($id, $key, $data)
139139
{
140140
foreach ($this->_buttons as $level => $buttons) {
141141
if (isset($buttons[$id])) {
@@ -162,11 +162,11 @@ protected function _updateButton($id, $key=null, $data)
162162
* Public wrapper for protected _updateButton method
163163
*
164164
* @param string $id
165-
* @param string|null $key
165+
* @param string $key
166166
* @param mixed $data
167167
* @return $this
168168
*/
169-
public function updateButton($id, $key=null, $data)
169+
public function updateButton($id, $key, $data)
170170
{
171171
return $this->_updateButton($id, $key, $data);
172172
}

app/code/core/Mage/Bundle/Model/Product/Price.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ public function getTotalBundleItemsPrice($product, $qty = null)
117117
/**
118118
* Get product final price
119119
*
120-
* @param double $qty
121-
* @param Mage_Catalog_Model_Product $product
120+
* @param float|null $qty
121+
* @param Mage_Catalog_Model_Product $product
122122
* @return double
123123
*/
124-
public function getFinalPrice($qty = null, $product)
124+
public function getFinalPrice($qty, $product)
125125
{
126126
if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {
127127
return $product->getCalculatedFinalPrice();
@@ -688,11 +688,11 @@ protected function _applyTierPrice($product, $qty, $finalPrice)
688688
/**
689689
* Get product tier price by qty
690690
*
691-
* @param float $qty
692-
* @param Mage_Catalog_Model_Product $product
691+
* @param float|null $qty
692+
* @param Mage_Catalog_Model_Product $product
693693
* @return float|array
694694
*/
695-
public function getTierPrice($qty = null, $product)
695+
public function getTierPrice($qty, $product)
696696
{
697697
$allGroups = Mage_Customer_Model_Group::CUST_GROUP_ALL;
698698
$prices = $product->getData('tier_price');

app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Price.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class Mage_Catalog_Model_Product_Type_Configurable_Price extends Mage_Catalog_Mo
3636
/**
3737
* Get product final price
3838
*
39-
* @param double $qty
40-
* @param Mage_Catalog_Model_Product $product
39+
* @param float|null $qty
40+
* @param Mage_Catalog_Model_Product $product
4141
* @return double
4242
*/
43-
public function getFinalPrice($qty = null, $product)
43+
public function getFinalPrice($qty, $product)
4444
{
4545
if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {
4646
return $product->getCalculatedFinalPrice();

app/code/core/Mage/Catalog/Model/Product/Type/Grouped/Price.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class Mage_Catalog_Model_Product_Type_Grouped_Price extends Mage_Catalog_Model_P
3636
/**
3737
* Returns product final price depending on options chosen
3838
*
39-
* @param double $qty
40-
* @param Mage_Catalog_Model_Product $product
39+
* @param float|null $qty
40+
* @param Mage_Catalog_Model_Product $product
4141
* @return double
4242
*/
43-
public function getFinalPrice($qty = null, $product)
43+
public function getFinalPrice($qty, $product)
4444
{
4545
if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {
4646
return $product->getCalculatedFinalPrice();

app/code/core/Mage/Catalog/Model/Product/Type/Price.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function getBasePrice($product, $qty = null)
7474
* @param Mage_Catalog_Model_Product $product
7575
* @return float
7676
*/
77-
public function getFinalPrice($qty = null, $product)
77+
public function getFinalPrice($qty, $product)
7878
{
7979
if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {
8080
return $product->getCalculatedFinalPrice();
@@ -181,11 +181,11 @@ protected function _applyTierPrice($product, $qty, $finalPrice)
181181
/**
182182
* Get product tier price by qty
183183
*
184-
* @param float $qty
185-
* @param Mage_Catalog_Model_Product $product
184+
* @param float|null $qty
185+
* @param Mage_Catalog_Model_Product $product
186186
* @return float|array
187187
*/
188-
public function getTierPrice($qty = null, $product)
188+
public function getTierPrice($qty, $product)
189189
{
190190
$allGroups = Mage_Customer_Model_Group::CUST_GROUP_ALL;
191191
$prices = $product->getData('tier_price');
@@ -307,11 +307,11 @@ public function getTierPriceCount($product)
307307
/**
308308
* Get formatted by currency tier price
309309
*
310-
* @param float $qty
311-
* @param Mage_Catalog_Model_Product $product
310+
* @param float|null $qty
311+
* @param Mage_Catalog_Model_Product $product
312312
* @return array|float
313313
*/
314-
public function getFormatedTierPrice($qty = null, $product)
314+
public function getFormatedTierPrice($qty, $product)
315315
{
316316
$price = $product->getTierPrice($qty);
317317
if (is_array($price)) {

app/code/core/Mage/Centinel/Model/Api/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
class Mage_Centinel_Model_Api_Client extends CentinelClient
3636
{
37-
public function sendHttp($url, $connectTimeout = "", $timeout)
37+
public function sendHttp($url, $connectTimeout, $timeout)
3838
{
3939
// verify that the URL uses a supported protocol.
4040
if ((strpos($url, "http://") === 0) || (strpos($url, "https://") === 0)) {

app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ public function indexProductImages($product, $preValues = null)
178178
public function getSwatchUrl(
179179
$product,
180180
$value,
181-
$width = self::SWATCH_DEFAULT_WIDTH,
182-
$height = self::SWATCH_DEFAULT_HEIGHT,
181+
$width,
182+
$height,
183183
&$swatchType,
184184
$fallbackFileExt = null
185185
) {

app/code/core/Mage/Core/Model/Locale.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ public function storeDate($store = null, $date = null, $includeTime = false, $fo
575575
* @param null|string $format
576576
* @return Zend_Date
577577
*/
578-
public function utcDate($store = null, $date, $includeTime = false, $format = null)
578+
public function utcDate($store, $date, $includeTime = false, $format = null)
579579
{
580580
$dateObj = $this->storeDate($store, $date, $includeTime);
581581
$dateObj->set($date, $format);

app/code/core/Mage/Downloadable/Model/Product/Price.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ class Mage_Downloadable_Model_Product_Price extends Mage_Catalog_Model_Product_T
3636
/**
3737
* Retrieve product final price
3838
*
39-
* @param integer $qty
39+
* @param integer|null $qty
4040
* @param Mage_Catalog_Model_Product $product
4141
* @return float
4242
*/
43-
public function getFinalPrice($qty = null, $product)
43+
public function getFinalPrice($qty, $product)
4444
{
4545
if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {
4646
return $product->getCalculatedFinalPrice();

app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public function getFilter()
201201
* @param string $name
202202
* @return array|bool
203203
*/
204-
protected function getFieldValue($fields = array(), $name)
204+
protected function getFieldValue($fields = array(), $name = '')
205205
{
206206
$result = array();
207207
if ($fields && $name) {

0 commit comments

Comments
 (0)