Skip to content

Commit 2bd7f76

Browse files
andrewbesskaryna-t
authored andcommitted
Fixes for static tests
1 parent e740589 commit 2bd7f76

File tree

6 files changed

+13
-11
lines changed

6 files changed

+13
-11
lines changed

app/code/Magento/CustomerImportExport/Model/ResourceModel/Import/Address/Storage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private function loadAddresses(array $customerIds): void
9898
$select->reset(Select::COLUMNS)->columns([$tableId . '.entity_id', $tableId . '.parent_id']);
9999

100100
$pageSize = $this->config->getValue(AbstractEntity::XML_PATH_PAGE_SIZE);
101-
$pageSize = !is_null($pageSize) ? (int) $pageSize : null;
101+
$pageSize = $pageSize !== null ? (int) $pageSize : null;
102102
$getChuck = function (int $offset) use ($customerIds, $pageSize) {
103103
return array_slice($customerIds, $offset, $pageSize);
104104
};

app/code/Magento/Paypal/Model/Express/Checkout.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ public function returnFromPaypal($token, string $payerIdentifier = null)
663663
) === \Magento\Paypal\Model\Config::REQUIRE_BILLING_ADDRESS_ALL;
664664

665665
if ($isButton && !$requireBillingAddress && !$quote->isVirtual()) {
666-
$billingAddress = clone $shippingAddress;
666+
$billingAddress = clone $shippingAddress; /** @phpstan-ignore-line */
667667
$billingAddress->unsAddressId()->unsAddressType()->setCustomerAddressId(null);
668668
$data = $billingAddress->getData();
669669
$data['save_in_address_book'] = 0;

app/code/Magento/Sales/Model/Order/ShipmentFactory.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,14 @@ protected function canShipItem($item, array $items = [])
287287
return isset($items[$parent->getId()]) && $items[$parent->getId()] > 0;
288288
}
289289
}
290-
} else {
291-
return $item->getQtyToShip() > 0;
292290
}
291+
292+
return $item->getQtyToShip() > 0;
293293
}
294294

295295
/**
296+
* Casts Qty to float or integer type
297+
*
296298
* @param Item $item
297299
* @param string|int|float $qty
298300
* @return float|int

app/code/Magento/Usps/Model/Carrier.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ protected function _parseXmlResponse($response)
634634
);
635635
}
636636
}
637-
uasort($priceArr, function($previous, $next){
637+
uasort($priceArr, function ($previous, $next) {
638638
return ($previous <= $next) ? -1 : 1;
639639
});
640640
} elseif (!$isUS && is_object($xml->Package->Service)) {
@@ -656,7 +656,7 @@ protected function _parseXmlResponse($response)
656656
);
657657
}
658658
}
659-
uasort($priceArr, function($previous, $next){
659+
uasort($priceArr, function ($previous, $next) {
660660
return ($previous <= $next) ? -1 : 1;
661661
});
662662
}

dev/tests/integration/testsuite/Magento/Framework/View/Utility/Layout.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
namespace Magento\Framework\View\Utility;
1111

1212
/**
13-
* Class Layout
13+
* The integration testsuite for Layout view utility
1414
*
1515
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
1616
*/
@@ -71,7 +71,7 @@ public function getLayoutUpdateFromFixture($layoutUpdatesFile)
7171
*
7272
* @param string|array $layoutUpdatesFile
7373
* @param array $args
74-
* @return \Magento\Framework\View\Layout|\PHPUnit_Framework_MockObject_MockObject
74+
* @return \Magento\Framework\View\Layout|\PHPUnit\Framework\MockObject\MockObject
7575
*/
7676
public function getLayoutFromFixture($layoutUpdatesFile, array $args = [])
7777
{

lib/internal/Magento/Framework/DB/Statement/Pdo/Mysql.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ public function _executeWithBinding(array $params)
4444
$driverOptions = null;
4545

4646
if ($param instanceof Parameter) {
47-
if ($param->getIsBlob()) {
48-
// Nothing to do there - default options are fine for MySQL driver
49-
} else {
47+
if (!$param->getIsBlob()) {
5048
$dataType = $param->getDataType();
5149
$length = $param->getLength();
5250
$driverOptions = $param->getDriverOptions();
@@ -71,6 +69,8 @@ public function _executeWithBinding(array $params)
7169
* @param array $params OPTIONAL Values to bind to parameter placeholders.
7270
* @return bool
7371
* @throws \Zend_Db_Statement_Exception
72+
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
73+
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
7474
*/
7575
public function _execute(array $params = null)
7676
{

0 commit comments

Comments
 (0)