5
5
*/
6
6
declare (strict_types=1 );
7
7
8
- namespace Magento \CmsGraphQl \Plugin ;
8
+ namespace Magento \CatalogGraphQl \Plugin ;
9
9
10
10
use Magento \Catalog \Model \Product ;
11
11
use Magento \Framework \Message \MessageInterface ;
12
+ use Magento \Framework \View \DesignLoader as ViewDesignLoader ;
13
+ use Magento \Framework \Message \ManagerInterface ;
14
+ use Magento \Catalog \Block \Product \ImageFactory ;
12
15
13
16
/**
14
17
* Load necessary design files for GraphQL
15
18
*/
16
19
class DesignLoader
17
20
{
18
21
/**
19
- * @var \Magento\Framework\View\ DesignLoader
22
+ * @var DesignLoader
20
23
*/
21
- protected $ designLoader ;
24
+ private $ designLoader ;
22
25
23
26
/**
24
- * @var \Magento\Framework\Message\ ManagerInterface
27
+ * @var ManagerInterface
25
28
*/
26
- protected $ messageManager ;
29
+ private $ messageManager ;
27
30
28
31
/**
29
- * @param \Magento\Framework\View\DesignLoader $designLoader
30
- * @param \Magento\Framework\Message\ ManagerInterface $messageManager
32
+ * @param ViewDesignLoader $designLoader
33
+ * @param ManagerInterface $messageManager
31
34
*/
32
35
public function __construct (
33
- \ Magento \ Framework \ View \ DesignLoader $ designLoader ,
34
- \ Magento \ Framework \ Message \ ManagerInterface $ messageManager
36
+ ViewDesignLoader $ designLoader ,
37
+ ManagerInterface $ messageManager
35
38
) {
36
39
$ this ->designLoader = $ designLoader ;
37
40
$ this ->messageManager = $ messageManager ;
@@ -40,15 +43,15 @@ public function __construct(
40
43
/**
41
44
* Before create load the design files
42
45
*
43
- * @param \Magento\Catalog\Block\Product\ ImageFactory $subject
46
+ * @param ImageFactory $subject
44
47
* @param Product $product
45
48
* @param string $imageId
46
49
* @param array|null $attributes
47
50
*
48
51
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
49
52
*/
50
53
public function beforeCreate (
51
- \ Magento \ Catalog \ Block \ Product \ ImageFactory $ subject ,
54
+ ImageFactory $ subject ,
52
55
Product $ product ,
53
56
string $ imageId ,
54
57
array $ attributes = null
@@ -65,4 +68,4 @@ public function beforeCreate(
65
68
}
66
69
}
67
70
}
68
- }
71
+ }
0 commit comments