objectManager = $objectManager; $defaultStrategies = [ self::DEPLOY_STRATEGY_STANDARD => StandardDeploy::class, self::DEPLOY_STRATEGY_QUICK => QuickDeploy::class, self::DEPLOY_STRATEGY_COMPACT => CompactDeploy::class, ]; $this->strategies = array_replace($defaultStrategies, $strategies); } /** * Create new instance of deployment strategy * * @param string $type * @param array $arguments * @return StrategyInterface * @throws InputException */ public function create($type, array $arguments = []) { $type = $type ?: self::DEPLOY_STRATEGY_STANDARD; if (!isset($this->strategies[$type])) { throw new InputException(__('Wrong deploy strategy type: %1', $type)); } return $this->objectManager->create($this->strategies[$type], $arguments); } }