File tree Expand file tree Collapse file tree 4 files changed +15
-12
lines changed
app/code/Magento/CatalogInventoryGraphQl/Model
dev/tests/api-functional/testsuite/Magento/GraphQl/CatalogInventory Expand file tree Collapse file tree 4 files changed +15
-12
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright 2024 Adobe
3
+ * Copyright 2025 Adobe
4
4
* All Rights Reserved.
5
5
*/
6
6
declare (strict_types=1 );
7
7
8
8
namespace Magento \CatalogInventoryGraphQl \Model \Resolver ;
9
9
10
+ use Magento \Framework \GraphQl \Query \Resolver \ContextInterface ;
10
11
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
11
12
use Magento \Framework \GraphQl \Config \Element \Field ;
12
13
use Magento \Framework \GraphQl \Query \ResolverInterface ;
@@ -37,10 +38,10 @@ public function __construct(
37
38
*/
38
39
public function resolve (
39
40
Field $ field ,
40
- $ context ,
41
+ ContextInterface $ context ,
41
42
ResolveInfo $ info ,
42
- array $ value = null ,
43
- array $ args = null
43
+ ? array $ value ,
44
+ ? array $ args
44
45
) {
45
46
$ stockItem = $ this ->stockItemService ->getStockItem ($ value ['model ' ]);
46
47
return $ stockItem ? $ stockItem ->getMaxSaleQty () : null ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright 2024 Adobe
3
+ * Copyright 2025 Adobe
4
4
* All Rights Reserved.
5
5
*/
6
6
declare (strict_types=1 );
7
7
8
8
namespace Magento \CatalogInventoryGraphQl \Model \Resolver ;
9
9
10
+ use Magento \Framework \GraphQl \Query \Resolver \ContextInterface ;
10
11
use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
11
12
use Magento \Framework \GraphQl \Config \Element \Field ;
12
13
use Magento \Framework \GraphQl \Query \ResolverInterface ;
@@ -37,10 +38,10 @@ public function __construct(
37
38
*/
38
39
public function resolve (
39
40
Field $ field ,
40
- $ context ,
41
+ ContextInterface $ context ,
41
42
ResolveInfo $ info ,
42
- array $ value = null ,
43
- array $ args = null
43
+ ? array $ value ,
44
+ ? array $ args
44
45
) {
45
46
$ stockItem = $ this ->stockItemService ->getStockItem ($ value ['model ' ]);
46
47
return $ stockItem ? $ stockItem ->getMinSaleQty () : null ;
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright 2024 Adobe
3
+ * Copyright 2025 Adobe
4
4
* All Rights Reserved.
5
5
*/
6
6
declare (strict_types=1 );
11
11
use Magento \Catalog \Model \Product ;
12
12
use Magento \Framework \Exception \LocalizedException ;
13
13
use Magento \CatalogInventory \Model \StockRegistry ;
14
+ use Magento \CatalogInventory \Model \Stock \Item ;
14
15
15
16
/**
16
17
* Service to provide stock item for given product
@@ -48,9 +49,9 @@ public function __construct(
48
49
* Returns stock item if the product is available
49
50
*
50
51
* @param Product|null $product
51
- * @return mixed
52
+ * @return Item
52
53
*/
53
- public function getStockItem (Product $ product = null )
54
+ public function getStockItem (? Product $ product )
54
55
{
55
56
if (!isset ($ product )) {
56
57
throw new LocalizedException (__ ('"model" value should be specified ' ));
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright 2024 Adobe
3
+ * Copyright 2025 Adobe
4
4
* All Rights Reserved.
5
5
*/
6
6
declare (strict_types=1 );
You can’t perform that action at this time.
0 commit comments