Skip to content

Commit c193a0a

Browse files
committed
Merge branch 'main' into rector/php81/FirstClassCallableRector
# Conflicts: # app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php # app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php # app/code/core/Mage/Paypal/Model/Payflowlink.php
2 parents a5bc562 + cc287dc commit c193a0a

File tree

14 files changed

+63
-114
lines changed

14 files changed

+63
-114
lines changed

.phpstan.dist.baseline.neon

Lines changed: 6 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -690,20 +690,14 @@ parameters:
690690
count: 1
691691
path: app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php
692692

693-
-
694-
rawMessage: 'Parameter #1 $order of method Mage_Sales_Model_Resource_Order_Collection_Abstract::setOrderFilter() expects int|Mage_Sales_Model_Order, array<string, mixed> given.'
695-
identifier: argument.type
696-
count: 1
697-
path: app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php
698-
699693
-
700694
rawMessage: 'Parameter #1 $prefix of function uniqid expects string, int<0, max> given.'
701695
identifier: argument.type
702696
count: 1
703697
path: app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php
704698

705699
-
706-
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, ''\\intval'' given.'
700+
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, Closure(array|bool|float|int|resource|string|null, int=): int given.'
707701
identifier: argument.type
708702
count: 2
709703
path: app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php
@@ -1225,7 +1219,7 @@ parameters:
12251219
path: app/code/core/Mage/Bundle/Model/Product/Type.php
12261220

12271221
-
1228-
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, ''\\intval'' given.'
1222+
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, Closure(array|bool|float|int|resource|string|null, int=): int given.'
12291223
identifier: argument.type
12301224
count: 3
12311225
path: app/code/core/Mage/Bundle/Model/Product/Type.php
@@ -1729,7 +1723,7 @@ parameters:
17291723
path: app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php
17301724

17311725
-
1732-
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, ''\\intval'' given.'
1726+
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, Closure(array|bool|float|int|resource|string|null, int=): int given.'
17331727
identifier: argument.type
17341728
count: 1
17351729
path: app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php
@@ -1747,7 +1741,7 @@ parameters:
17471741
path: app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php
17481742

17491743
-
1750-
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, ''\\intval'' given.'
1744+
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, Closure(array|bool|float|int|resource|string|null, int=): int given.'
17511745
identifier: argument.type
17521746
count: 1
17531747
path: app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php
@@ -2479,7 +2473,7 @@ parameters:
24792473
path: app/code/core/Mage/Core/Controller/Varien/Router/Standard.php
24802474

24812475
-
2482-
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(string): bool)|null, ''trim'' given.'
2476+
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(string): bool)|null, Closure(string, string=): string given.'
24832477
identifier: argument.type
24842478
count: 1
24852479
path: app/code/core/Mage/Core/Helper/EnvironmentConfigLoader.php
@@ -3223,7 +3217,7 @@ parameters:
32233217
path: app/code/core/Mage/Downloadable/Model/Link/Api/V2.php
32243218

32253219
-
3226-
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, ''\\intval'' given.'
3220+
rawMessage: 'Parameter #2 $callback of function array_filter expects (callable(mixed): bool)|null, Closure(array|bool|float|int|resource|string|null, int=): int given.'
32273221
identifier: argument.type
32283222
count: 1
32293223
path: app/code/core/Mage/Downloadable/Model/Product/Type.php
@@ -4284,12 +4278,6 @@ parameters:
42844278
count: 1
42854279
path: app/code/core/Mage/Sales/Block/Recurring/Profiles.php
42864280

4287-
-
4288-
rawMessage: 'Parameter #1 $order of method Mage_Sales_Model_Resource_Order_Collection_Abstract::setOrderFilter() expects int|Mage_Sales_Model_Order, array given.'
4289-
identifier: argument.type
4290-
count: 1
4291-
path: app/code/core/Mage/Sales/Model/Api2/Order.php
4292-
42934281
-
42944282
rawMessage: 'Parameter #2 $code of method Mage_Api2_Model_Resource::_critical() expects int|null, string given.'
42954283
identifier: argument.type
@@ -4938,12 +4926,6 @@ parameters:
49384926
count: 2
49394927
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php
49404928

4941-
-
4942-
rawMessage: 'Parameter #3 $value of function curl_setopt expects bool, int given.'
4943-
identifier: argument.type
4944-
count: 2
4945-
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php
4946-
49474929
-
49484930
rawMessage: 'Property Mage_Usa_Model_Shipping_Carrier_Dhl::$_request (Mage_Shipping_Model_Rate_Request|null) does not accept Varien_Object.'
49494931
identifier: assign.propertyType
@@ -5022,12 +5004,6 @@ parameters:
50225004
count: 1
50235005
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
50245006

5025-
-
5026-
rawMessage: 'Parameter #3 $value of function curl_setopt expects bool, int given.'
5027-
identifier: argument.type
5028-
count: 2
5029-
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
5030-
50315007
-
50325008
rawMessage: 'Property Mage_Usa_Model_Shipping_Carrier_Fedex::$_result (Mage_Shipping_Model_Rate_Result|null) does not accept Mage_Shipping_Model_Tracking_Result.'
50335009
identifier: assign.propertyType
@@ -5046,30 +5022,12 @@ parameters:
50465022
count: 1
50475023
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
50485024

5049-
-
5050-
rawMessage: 'Parameter #1 $string of function strlen expects string, array|false given.'
5051-
identifier: argument.type
5052-
count: 1
5053-
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
5054-
50555025
-
50565026
rawMessage: 'Parameter #2 $value of method SimpleXMLElement::addChild() expects string|null, float given.'
50575027
identifier: argument.type
50585028
count: 1
50595029
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
50605030

5061-
-
5062-
rawMessage: 'Parameter #3 $value of function curl_setopt expects bool, int given.'
5063-
identifier: argument.type
5064-
count: 18
5065-
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
5066-
5067-
-
5068-
rawMessage: 'Parameter #3 $value of function curl_setopt expects bool, int given.'
5069-
identifier: argument.type
5070-
count: 3
5071-
path: app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php
5072-
50735031
-
50745032
rawMessage: 'Parameter #2 $serviceType of method Mage_Usa_Model_Shipping_Carrier_Usps::_formUsSignatureConfirmationShipmentRequest() expects string, array|bool given.'
50755033
identifier: argument.type
@@ -6000,18 +5958,6 @@ parameters:
60005958
count: 1
60015959
path: lib/Mage/DB/Mysqli.php
60025960

6003-
-
6004-
rawMessage: 'Parameter #1 $handle of function curl_setopt expects CurlHandle, resource|false given.'
6005-
identifier: argument.type
6006-
count: 1
6007-
path: lib/Mage/HTTP/Client/Curl.php
6008-
6009-
-
6010-
rawMessage: 'Parameter #1 $handle of function curl_setopt_array expects CurlHandle, resource|false given.'
6011-
identifier: argument.type
6012-
count: 1
6013-
path: lib/Mage/HTTP/Client/Curl.php
6014-
60155961
-
60165962
rawMessage: Empty array passed to foreach.
60175963
identifier: foreach.emptyArray
@@ -6288,12 +6234,6 @@ parameters:
62886234
count: 1
62896235
path: lib/Varien/Filter/Template/Tokenizer/Variable.php
62906236

6291-
-
6292-
rawMessage: 'Parameter #3 $value of function curl_setopt expects bool, int given.'
6293-
identifier: argument.type
6294-
count: 2
6295-
path: lib/Varien/Http/Adapter/Curl.php
6296-
62976237
-
62986238
rawMessage: 'Parameter #2 $enable of function imageinterlace expects bool|null, int given.'
62996239
identifier: argument.type

app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,8 @@ public function createLabelAction()
579579

580580
/**
581581
* Print label for one specific shipment
582+
*
583+
* @return Mage_Core_Controller_Varien_Action|void
582584
*/
583585
public function printLabelAction()
584586
{
@@ -652,7 +654,7 @@ public function massPrintShippingLabelAction()
652654
switch ($request->getParam('massaction_prepare_key')) {
653655
case 'shipment_ids':
654656
$ids = $request->getParam('shipment_ids');
655-
array_filter($ids, \intval(...));
657+
$ids = array_filter($ids, \intval(...));
656658
if (!empty($ids)) {
657659
$shipments = Mage::getResourceModel('sales/order_shipment_collection')
658660
->addFieldToFilter('entity_id', ['in' => $ids]);
@@ -661,7 +663,7 @@ public function massPrintShippingLabelAction()
661663
break;
662664
case 'order_ids':
663665
$ids = $request->getParam('order_ids');
664-
array_filter($ids, \intval(...));
666+
$ids = array_filter($ids, \intval(...));
665667
if (!empty($ids)) {
666668
$shipments = Mage::getResourceModel('sales/order_shipment_collection')
667669
->setOrderFilter(['in' => $ids]);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ public function sendHttp($url, $connectTimeout, $timeout)
3030
$ch = curl_init($url);
3131

3232
// set URL and other appropriate options
33-
curl_setopt($ch, CURLOPT_POST, 1);
33+
curl_setopt($ch, CURLOPT_POST, true);
3434
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
3535
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
36-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
37-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
36+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
37+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
3838
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
3939

4040
// Execute the request.

app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,11 @@ public function getAttributeOptions(Mage_Eav_Model_Entity_Attribute_Abstract $at
382382
public function getBehavior()
383383
{
384384
if (!isset($this->_parameters['behavior'])
385-
|| (!in_array($this->_parameters['behavior'], [Mage_ImportExport_Model_Import::BEHAVIOR_APPEND, Mage_ImportExport_Model_Import::BEHAVIOR_REPLACE, Mage_ImportExport_Model_Import::BEHAVIOR_DELETE]))
385+
|| (!in_array($this->_parameters['behavior'], [
386+
Mage_ImportExport_Model_Import::BEHAVIOR_APPEND,
387+
Mage_ImportExport_Model_Import::BEHAVIOR_REPLACE,
388+
Mage_ImportExport_Model_Import::BEHAVIOR_DELETE,
389+
]))
386390
) {
387391
return Mage_ImportExport_Model_Import::getDefaultBehavior();
388392
}

app/code/core/Mage/Paypal/Model/Payflowlink.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,11 @@ protected function _getOrderFromResponse()
340340
return false;
341341
}
342342

343-
if (!in_array($response->getResult(), [self::RESPONSE_CODE_FRAUDSERVICE_FILTER, self::RESPONSE_CODE_DECLINED_BY_FILTER, self::RESPONSE_CODE_APPROVED])
344-
) {
343+
if (!in_array($response->getResult(), [
344+
self::RESPONSE_CODE_FRAUDSERVICE_FILTER,
345+
self::RESPONSE_CODE_DECLINED_BY_FILTER,
346+
self::RESPONSE_CODE_APPROVED,
347+
])) {
345348
if ($order->getState() != Mage_Sales_Model_Order::STATE_CANCELED) {
346349
$order->registerCancellation($response->getRespmsg())->save();
347350
}

app/code/core/Mage/Sales/Model/Resource/Order/Collection/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function getSalesOrder()
6161
/**
6262
* Add order filter
6363
*
64-
* @param int|Mage_Sales_Model_Order $order
64+
* @param array|int|null|string|Mage_Sales_Model_Order $order
6565
* @return $this
6666
*/
6767
public function setOrderFilter($order)

app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ protected function _doRequest()
539539
}
540540

541541
$ch = curl_init();
542-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
542+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
543543
curl_setopt($ch, CURLOPT_URL, $url);
544544
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getConfigFlag('verify_peer'));
545545
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
@@ -1041,7 +1041,7 @@ protected function _getXMLTracking($trackings)
10411041
}
10421042

10431043
$ch = curl_init();
1044-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1044+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
10451045
curl_setopt($ch, CURLOPT_URL, $url);
10461046
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getConfigFlag('verify_peer'));
10471047
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);

app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,9 @@ protected function _getXmlQuotes()
649649
}
650650

651651
$ch = curl_init();
652-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
652+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
653653
curl_setopt($ch, CURLOPT_URL, $url);
654-
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
654+
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
655655
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
656656
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
657657
$responseBody = curl_exec($ch);

app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ protected function _setFreeMethodRequest($freeMethod)
355355
*
356356
* @param string $code
357357
* @param string $origin
358-
* @return array|false
358+
* @return string|false
359359
*/
360360
public function getShipmentByCode($code, $origin = null)
361361
{
@@ -798,9 +798,9 @@ protected function _getXmlQuotes()
798798
$debugData = ['request' => $xmlRequest];
799799
$ch = curl_init();
800800
curl_setopt($ch, CURLOPT_URL, $url);
801-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
802-
curl_setopt($ch, CURLOPT_HEADER, 0);
803-
curl_setopt($ch, CURLOPT_POST, 1);
801+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
802+
curl_setopt($ch, CURLOPT_HEADER, false);
803+
curl_setopt($ch, CURLOPT_POST, true);
804804
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
805805
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
806806
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getConfigFlag('verify_peer'));
@@ -1016,9 +1016,9 @@ protected function _getXmlTracking($trackings)
10161016

10171017
$ch = curl_init();
10181018
curl_setopt($ch, CURLOPT_URL, $url);
1019-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1020-
curl_setopt($ch, CURLOPT_HEADER, 0);
1021-
curl_setopt($ch, CURLOPT_POST, 1);
1019+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1020+
curl_setopt($ch, CURLOPT_HEADER, false);
1021+
curl_setopt($ch, CURLOPT_POST, true);
10221022
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
10231023
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
10241024
$xmlResponse = curl_exec($ch);
@@ -1592,9 +1592,9 @@ protected function _sendShipmentAcceptRequest(SimpleXMLElement $shipmentConfirmR
15921592
}
15931593

15941594
$ch = curl_init($url);
1595-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1596-
curl_setopt($ch, CURLOPT_HEADER, 0);
1597-
curl_setopt($ch, CURLOPT_POST, 1);
1595+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1596+
curl_setopt($ch, CURLOPT_HEADER, false);
1597+
curl_setopt($ch, CURLOPT_POST, true);
15981598
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->_xmlAccessRequest . $xmlRequest->asXML());
15991599
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
16001600
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getConfigFlag('verify_peer'));
@@ -1700,9 +1700,9 @@ protected function _doShipmentRequestRest(Varien_Object $request): Varien_Object
17001700

17011701
$ch = curl_init();
17021702
curl_setopt($ch, CURLOPT_URL, $shipConfirmUrl);
1703-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
1704-
curl_setopt($ch, CURLOPT_HEADER, 0);
1705-
curl_setopt($ch, CURLOPT_POST, 1);
1703+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
1704+
curl_setopt($ch, CURLOPT_HEADER, false);
1705+
curl_setopt($ch, CURLOPT_POST, true);
17061706
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
17071707
curl_setopt($ch, CURLOPT_POSTFIELDS, $rawJsonRequest);
17081708
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
@@ -2013,9 +2013,9 @@ protected function _doShipmentRequestXML(Varien_Object $request): Varien_Object
20132013
$debugData = ['request' => $xmlRequest];
20142014
$ch = curl_init();
20152015
curl_setopt($ch, CURLOPT_URL, $url);
2016-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
2017-
curl_setopt($ch, CURLOPT_HEADER, 0);
2018-
curl_setopt($ch, CURLOPT_POST, 1);
2016+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
2017+
curl_setopt($ch, CURLOPT_HEADER, false);
2018+
curl_setopt($ch, CURLOPT_POST, true);
20192019
curl_setopt($ch, CURLOPT_POSTFIELDS, $xmlRequest);
20202020
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
20212021
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->getConfigFlag('verify_peer'));
@@ -2342,9 +2342,9 @@ protected function _getRestQuotes()
23422342

23432343
$ch = curl_init();
23442344
curl_setopt($ch, CURLOPT_URL, $url . $version . '/' . $requestOption);
2345-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
2346-
curl_setopt($ch, CURLOPT_HEADER, 0);
2347-
curl_setopt($ch, CURLOPT_POST, 1);
2345+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
2346+
curl_setopt($ch, CURLOPT_HEADER, false);
2347+
curl_setopt($ch, CURLOPT_POST, true);
23482348
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
23492349
curl_setopt($ch, CURLOPT_POSTFIELDS, $ratePayload);
23502350
curl_setopt($ch, CURLOPT_TIMEOUT, 30);

app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public function getAccessToken(string $clientId, string $clientSecret, string $c
4242
]);
4343
$ch = curl_init();
4444
curl_setopt($ch, CURLOPT_URL, $clientUrl);
45-
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
46-
curl_setopt($ch, CURLOPT_HEADER, 0);
47-
curl_setopt($ch, CURLOPT_POST, 1);
45+
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
46+
curl_setopt($ch, CURLOPT_HEADER, false);
47+
curl_setopt($ch, CURLOPT_POST, true);
4848
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
4949
curl_setopt($ch, CURLOPT_POSTFIELDS, $authPayload);
5050
curl_setopt($ch, CURLOPT_TIMEOUT, 30);

0 commit comments

Comments
 (0)