8
8
9
9
namespace Magento \PageBuilder \Controller \Adminhtml \Form \Element ;
10
10
11
+ use Exception ;
12
+ use Magento \Backend \App \Action ;
13
+ use Magento \Backend \App \Action \Context ;
11
14
use Magento \Framework \App \Action \HttpPostActionInterface ;
15
+ use Magento \Framework \Controller \Result \JsonFactory ;
12
16
13
17
/**
14
18
* Returns the number of products that match the provided conditions
15
19
*/
16
- class ProductTotals extends \ Magento \ Backend \ App \ Action implements HttpPostActionInterface
20
+ class ProductTotals extends Action implements HttpPostActionInterface
17
21
{
18
22
const ADMIN_RESOURCE = 'Magento_Catalog::products ' ;
19
23
@@ -23,19 +27,19 @@ class ProductTotals extends \Magento\Backend\App\Action implements HttpPostActio
23
27
private $ productTotals ;
24
28
25
29
/**
26
- * @var \Magento\Framework\Controller\Result\ JsonFactory
30
+ * @var JsonFactory
27
31
*/
28
32
private $ jsonFactory ;
29
33
30
34
/**
31
- * @param \Magento\Backend\App\Action\ Context $context
35
+ * @param Context $context
32
36
* @param \Magento\PageBuilder\Model\Catalog\ProductTotals $productTotals
33
- * @param \Magento\Framework\Controller\Result\ JsonFactory $jsonFactory
37
+ * @param JsonFactory $jsonFactory
34
38
*/
35
39
public function __construct (
36
- \ Magento \ Backend \ App \ Action \ Context $ context ,
40
+ Context $ context ,
37
41
\Magento \PageBuilder \Model \Catalog \ProductTotals $ productTotals ,
38
- \ Magento \ Framework \ Controller \ Result \ JsonFactory $ jsonFactory
42
+ JsonFactory $ jsonFactory
39
43
) {
40
44
$ this ->jsonFactory = $ jsonFactory ;
41
45
$ this ->productTotals = $ productTotals ;
@@ -57,7 +61,7 @@ public function execute()
57
61
'notVisible ' => $ totals ['notVisible ' ],
58
62
'outOfStock ' => $ totals ['outOfStock ' ],
59
63
];
60
- } catch (\ Exception $ e ) {
64
+ } catch (Exception $ e ) {
61
65
$ response = [
62
66
'total ' => 0 ,
63
67
'disabled ' => 0 ,
0 commit comments