10
10
use Magento \Cms \Api \Data \PageInterface ;
11
11
use Magento \Cms \Api \GetPageByIdentifierInterface ;
12
12
use Magento \Cms \Api \PageRepositoryInterface ;
13
- use Magento \Framework \App \ObjectManager ;
14
13
use Magento \Framework \Exception \NoSuchEntityException ;
15
14
use Magento \Store \Model \StoreManagerInterface ;
16
15
use Magento \Widget \Model \Template \FilterEmulate ;
@@ -49,14 +48,14 @@ class Page
49
48
public function __construct (
50
49
PageRepositoryInterface $ pageRepository ,
51
50
FilterEmulate $ widgetFilter ,
52
- GetPageByIdentifierInterface $ getPageByIdentifier = null ,
53
- StoreManagerInterface $ storeManager = null
51
+ GetPageByIdentifierInterface $ getPageByIdentifier ,
52
+ StoreManagerInterface $ storeManager
54
53
) {
55
54
56
55
$ this ->pageRepository = $ pageRepository ;
57
56
$ this ->widgetFilter = $ widgetFilter ;
58
- $ this ->pageByIdentifier = $ getPageByIdentifier ?: ObjectManager:: getInstance ()-> get (GetPageByIdentifierInterface::class) ;
59
- $ this ->storeManager = $ storeManager ?: ObjectManager:: getInstance ()-> get (StoreManagerInterface::class) ;
57
+ $ this ->pageByIdentifier = $ getPageByIdentifier ;
58
+ $ this ->storeManager = $ storeManager ;
60
59
}
61
60
62
61
/**
@@ -72,7 +71,7 @@ public function __construct(
72
71
public function getData (int $ pageId ): array
73
72
{
74
73
$ page = $ this ->pageRepository ->getById ($ pageId );
75
-
74
+
76
75
return $ this ->convertPageData ($ page );
77
76
}
78
77
0 commit comments