@@ -181,10 +181,28 @@ protected function execute(InputInterface $input, OutputInterface $output)
181181 $ this ->state ->setAreaCode (\Magento \Framework \App \Area::AREA_ADMINHTML );
182182
183183 /*
184- * Input
184+ * Configuration
185185 */
186- /** @var Configuration $configuration */
187- $ configuration = $ this ->configurationFactory ->create ();
186+ $ configuration = $ this ->loadConfiguration (
187+ $ this ->configurationFactory ->create (),
188+ $ input
189+ );
190+
191+ /*
192+ * Processing
193+ */
194+ $ this ->eventManager ->dispatch ('aid_content_fuzzyfyr_event ' , ['configuration ' => $ configuration ]);
195+
196+ $ output ->writeln ('Finished content fuzzyfy ' );
197+ }
198+
199+ /**
200+ * @param Configuration $configuration
201+ * @param InputInterface $input
202+ * @return Configuration
203+ */
204+ protected function loadConfiguration (Configuration $ configuration , InputInterface $ input )
205+ {
188206 // --- Flags
189207 $ configuration ->setUseOnlyEmpty ($ input ->getOption (self ::FLAG_ONLY_EMPTY ));
190208 $ configuration ->setApplyToCategories ($ input ->getOption (self ::FLAG_CATEGORIES ));
@@ -193,17 +211,13 @@ protected function execute(InputInterface $input, OutputInterface $output)
193211 $ configuration ->setApplyToCustomers ($ input ->getOption (self ::FLAG_CUSTOMERS ));
194212 $ configuration ->setApplyToProducts ($ input ->getOption (self ::FLAG_PRODUCTS ));
195213 $ configuration ->setApplyToUsers ($ input ->getOption (self ::FLAG_USERS ));
214+
196215 // --- Options
197216 $ configuration ->setDummyContentText ($ input ->getOption (self ::OPTION_DUMMY_CONTENT_TEXT ));
198217 $ configuration ->setDummyContentEmail ($ input ->getOption (self ::OPTION_DUMMY_CONTENT_EMAIL ));
199218 $ configuration ->setDummyContentUrl ($ input ->getOption (self ::OPTION_DUMMY_CONTENT_URL ));
200219 $ configuration ->setDummyPhoneNumber ($ input ->getOption (self ::OPTION_DUMMY_CONTENT_PHONE ));
201220
202- /*
203- * Processing
204- */
205- $ this ->eventManager ->dispatch ('aid_content_fuzzyfyr_event ' , ['configuration ' => $ configuration ]);
206-
207- $ output ->writeln ('Finished content fuzzyfy ' );
221+ return $ configuration ;
208222 }
209223}
0 commit comments