1010
1111use Magento \Framework \App \ResourceConnection ;
1212use Magento \Framework \DB \Ddl \Trigger ;
13+ use Magento \Framework \DB \Ddl \TriggerFactory ;
14+ use Magento \Framework \Mview \ViewInterface ;
1315
1416class Subscription implements SubscriptionInterface
1517{
@@ -21,12 +23,12 @@ class Subscription implements SubscriptionInterface
2123 protected $ connection ;
2224
2325 /**
24- * @var \Magento\Framework\DB\Ddl\ TriggerFactory
26+ * @var TriggerFactory
2527 */
2628 protected $ triggerFactory ;
2729
2830 /**
29- * @var \Magento\Framework\Mview\View\ CollectionInterface
31+ * @var CollectionInterface
3032 */
3133 protected $ viewCollection ;
3234
@@ -67,21 +69,21 @@ class Subscription implements SubscriptionInterface
6769
6870 /**
6971 * @param ResourceConnection $resource
70- * @param \Magento\Framework\DB\Ddl\ TriggerFactory $triggerFactory
71- * @param \Magento\Framework\Mview\View\ CollectionInterface $viewCollection
72- * @param \Magento\Framework\Mview\ ViewInterface $view
72+ * @param TriggerFactory $triggerFactory
73+ * @param CollectionInterface $viewCollection
74+ * @param ViewInterface $view
7375 * @param string $tableName
7476 * @param string $columnName
7577 * @param array $ignoredUpdateColumns
7678 */
7779 public function __construct (
7880 ResourceConnection $ resource ,
79- \ Magento \ Framework \ DB \ Ddl \ TriggerFactory $ triggerFactory ,
80- \ Magento \ Framework \ Mview \ View \ CollectionInterface $ viewCollection ,
81- \ Magento \ Framework \ Mview \ ViewInterface $ view ,
81+ TriggerFactory $ triggerFactory ,
82+ CollectionInterface $ viewCollection ,
83+ ViewInterface $ view ,
8284 $ tableName ,
8385 $ columnName ,
84- $ ignoredUpdateColumns = []
86+ array $ ignoredUpdateColumns = []
8587 ) {
8688 $ this ->connection = $ resource ->getConnection ();
8789 $ this ->triggerFactory = $ triggerFactory ;
@@ -94,9 +96,9 @@ public function __construct(
9496 }
9597
9698 /**
97- * Create subsciption
99+ * Create subscription
98100 *
99- * @return \Magento\Framework\Mview\View\ SubscriptionInterface
101+ * @return SubscriptionInterface
100102 */
101103 public function create ()
102104 {
@@ -113,7 +115,7 @@ public function create()
113115
114116 // Add statements for linked views
115117 foreach ($ this ->getLinkedViews () as $ view ) {
116- /** @var \Magento\Framework\Mview\ ViewInterface $view */
118+ /** @var ViewInterface $view */
117119 $ trigger ->addStatement ($ this ->buildStatement ($ event , $ view ->getChangelog ()));
118120 }
119121
@@ -127,7 +129,7 @@ public function create()
127129 /**
128130 * Remove subscription
129131 *
130- * @return \Magento\Framework\Mview\View\ SubscriptionInterface
132+ * @return SubscriptionInterface
131133 */
132134 public function remove ()
133135 {
@@ -142,7 +144,7 @@ public function remove()
142144
143145 // Add statements for linked views
144146 foreach ($ this ->getLinkedViews () as $ view ) {
145- /** @var \Magento\Framework\Mview\ ViewInterface $view */
147+ /** @var ViewInterface $view */
146148 $ trigger ->addStatement ($ this ->buildStatement ($ event , $ view ->getChangelog ()));
147149 }
148150
@@ -165,10 +167,10 @@ public function remove()
165167 protected function getLinkedViews ()
166168 {
167169 if (!$ this ->linkedViews ) {
168- $ viewList = $ this ->viewCollection ->getViewsByStateMode (\ Magento \ Framework \ Mview \ View \ StateInterface::MODE_ENABLED );
170+ $ viewList = $ this ->viewCollection ->getViewsByStateMode (StateInterface::MODE_ENABLED );
169171
170172 foreach ($ viewList as $ view ) {
171- /** @var \Magento\Framework\Mview\ ViewInterface $view */
173+ /** @var ViewInterface $view */
172174 // Skip the current view
173175 if ($ view ->getId () == $ this ->getView ()->getId ()) {
174176 continue ;
@@ -189,10 +191,10 @@ protected function getLinkedViews()
189191 * Build trigger statement for INSERT, UPDATE, DELETE events
190192 *
191193 * @param string $event
192- * @param \Magento\Framework\Mview\View\ ChangelogInterface $changelog
194+ * @param ChangelogInterface $changelog
193195 * @return string
194196 */
195- protected function buildStatement ($ event , $ changelog )
197+ protected function buildStatement (string $ event , ChangelogInterface $ changelog )
196198 {
197199 switch ($ event ) {
198200 case Trigger::EVENT_INSERT :
@@ -259,7 +261,7 @@ private function getAfterEventTriggerName($event)
259261 /**
260262 * Retrieve View related to subscription
261263 *
262- * @return \Magento\Framework\Mview\ ViewInterface
264+ * @return ViewInterface
263265 * @codeCoverageIgnore
264266 */
265267 public function getView ()
0 commit comments