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 11<?php
22/**
3- * Copyright 2024 Adobe
3+ * Copyright 2025 Adobe
44 * All Rights Reserved.
55 */
66declare (strict_types=1 );
77
88namespace Magento \CatalogInventoryGraphQl \Model \Resolver ;
99
10+ use Magento \Framework \GraphQl \Query \Resolver \ContextInterface ;
1011use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
1112use Magento \Framework \GraphQl \Config \Element \Field ;
1213use Magento \Framework \GraphQl \Query \ResolverInterface ;
@@ -37,10 +38,10 @@ public function __construct(
3738 */
3839 public function resolve (
3940 Field $ field ,
40- $ context ,
41+ ContextInterface $ context ,
4142 ResolveInfo $ info ,
42- array $ value = null ,
43- array $ args = null
43+ ? array $ value ,
44+ ? array $ args
4445 ) {
4546 $ stockItem = $ this ->stockItemService ->getStockItem ($ value ['model ' ]);
4647 return $ stockItem ? $ stockItem ->getMaxSaleQty () : null ;
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright 2024 Adobe
3+ * Copyright 2025 Adobe
44 * All Rights Reserved.
55 */
66declare (strict_types=1 );
77
88namespace Magento \CatalogInventoryGraphQl \Model \Resolver ;
99
10+ use Magento \Framework \GraphQl \Query \Resolver \ContextInterface ;
1011use Magento \Framework \GraphQl \Schema \Type \ResolveInfo ;
1112use Magento \Framework \GraphQl \Config \Element \Field ;
1213use Magento \Framework \GraphQl \Query \ResolverInterface ;
@@ -37,10 +38,10 @@ public function __construct(
3738 */
3839 public function resolve (
3940 Field $ field ,
40- $ context ,
41+ ContextInterface $ context ,
4142 ResolveInfo $ info ,
42- array $ value = null ,
43- array $ args = null
43+ ? array $ value ,
44+ ? array $ args
4445 ) {
4546 $ stockItem = $ this ->stockItemService ->getStockItem ($ value ['model ' ]);
4647 return $ stockItem ? $ stockItem ->getMinSaleQty () : null ;
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright 2024 Adobe
3+ * Copyright 2025 Adobe
44 * All Rights Reserved.
55 */
66declare (strict_types=1 );
1111use Magento \Catalog \Model \Product ;
1212use Magento \Framework \Exception \LocalizedException ;
1313use Magento \CatalogInventory \Model \StockRegistry ;
14+ use Magento \CatalogInventory \Model \Stock \Item ;
1415
1516/**
1617 * Service to provide stock item for given product
@@ -48,9 +49,9 @@ public function __construct(
4849 * Returns stock item if the product is available
4950 *
5051 * @param Product|null $product
51- * @return mixed
52+ * @return Item
5253 */
53- public function getStockItem (Product $ product = null )
54+ public function getStockItem (? Product $ product )
5455 {
5556 if (!isset ($ product )) {
5657 throw new LocalizedException (__ ('"model" value should be specified ' ));
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright 2024 Adobe
3+ * Copyright 2025 Adobe
44 * All Rights Reserved.
55 */
66declare (strict_types=1 );
You can’t perform that action at this time.
0 commit comments