Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $depCtor = new RuntimeDependencyConstructor();
     $deps = $depCtor->constructDependencies($input->getOption(CommonOptions::STORE), $input->getOption(CommonOptions::KEY), $input->getOption(CommonOptions::PASSWORD));
     /** @var \ShopFitter\Shopfile\Parser $parser */
     $parser = $deps[\ShopFitter\Shopfile\Parser::class];
     /** @var \ShopFitter\Plan\Theme\ThemeActionPlanner $planner */
     $planner = $deps[\ShopFitter\Plan\Theme\ThemeActionPlanner::class];
     $shopfilePath = $input->getOption(CommonOptions::SHOPFILE) ?: "./shopfile";
     $shopfile = $parser->parse(file_get_contents($shopfilePath));
     $plan = $planner->generatePlan(getcwd(), $shopfile);
     $this->configureStyling($output);
     foreach ($plan as $file => $planRow) {
         $output->writeln(sprintf("<%1\$s>[%1\$s] \t\t\t %2\$s</>", strtoupper($planRow["strategy"]), $file));
     }
 }
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $depCtor = new RuntimeDependencyConstructor();
     $deps = $depCtor->constructDependencies($input->getOption(CommonOptions::STORE), $input->getOption(CommonOptions::KEY), $input->getOption(CommonOptions::PASSWORD));
     /** @var \ShopFitter\Shopfile\Parser $parser */
     $parser = $deps[\ShopFitter\Shopfile\Parser::class];
     /** @var \ShopFitter\Plan\Theme\ThemeActionPlanner $planner */
     $planner = $deps[\ShopFitter\Plan\Theme\ThemeActionPlanner::class];
     /** @var \ShopFitter\Plan\Theme\ThemePlanExecutor $executor */
     $executor = $deps[\ShopFitter\Plan\Theme\ThemePlanExecutor::class];
     $shopfilePath = $input->getOption(CommonOptions::SHOPFILE) ?: "./shopfile";
     $shopfile = $parser->parse(file_get_contents($shopfilePath));
     $plan = $planner->generatePlan(getcwd(), $shopfile);
     try {
         $executor->executePlan($input->getOption(CommonOptions::THEME), $plan);
     } catch (\GuzzleHttp\Exception\BadResponseException $ex) {
         $this->showBadResponseMessage($ex, $output);
     }
 }