Skip to content

Commit 04954ef

Browse files
committed
MAGETWO-69828: [GitHub] Concurrent checkouts can lead to negative stock #6363
1 parent 6fa1f22 commit 04954ef

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

app/code/Magento/CatalogInventory/Model/ResourceModel/Stock.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ protected function _construct()
119119
* @param int $websiteId
120120
* @return array
121121
*/
122-
public function lockProductsStock(array $productIds, $websiteId)
122+
public function lockProductsStock(array $productIds, int $websiteId)
123123
{
124124
if (empty($productIds)) {
125125
return [];

app/code/Magento/CatalogInventory/Test/Unit/Model/ResourceModel/StockTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ protected function setUp()
118118
*
119119
* @return void
120120
*/
121-
public function testLockProductsStock($websiteId, array $productIds, array $products, array $result)
121+
public function testLockProductsStock(int $websiteId, array $productIds, array $products, array $result)
122122
{
123123
$this->selectMock->expects($this->exactly(2))
124124
->method('from')
@@ -178,7 +178,7 @@ public function testLockProductsStock($websiteId, array $productIds, array $prod
178178
/**
179179
* @return array
180180
*/
181-
public function productsDataProvider()
181+
public function productsDataProvider(): array
182182
{
183183
return [
184184
[

app/code/Magento/CatalogInventory/Test/Unit/Model/StockManagementTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function testRegisterProductsSaleException(array $items, array $lockedIte
236236
/**
237237
* @return array
238238
*/
239-
public function productsWithCorrectQtyDataProvider()
239+
public function productsWithCorrectQtyDataProvider(): array
240240
{
241241
return [
242242
[
@@ -276,7 +276,7 @@ public function productsWithCorrectQtyDataProvider()
276276
/**
277277
* @return array
278278
*/
279-
public function productsWithIncorrectQtyDataProvider()
279+
public function productsWithIncorrectQtyDataProvider(): array
280280
{
281281
return [
282282
[

0 commit comments

Comments
 (0)