rootDirectory = dirname(__DIR__, 2); $this->system = new System(); $this->setFilePaths(); parent::__construct(); } protected function execute(InputInterface $input, OutputInterface $output): int { $this->setStyle($input, $output); if (!$this->system->isDockerEngineRunning()) { $this->style->error('It looks like the Docker Engine is not running. Please start it and try again.'); return Command::FAILURE; } if ($input->hasArgument('path')) { $projectDirectory = new FilePath($input->getArgument('path')); if (!$projectDirectory->exists() || !$projectDirectory->isDirectory()) { $this->style->error('The provided path is not a valid directory.'); return Command::FAILURE; } $this->filePaths->add($projectDirectory, 'project'); } return Command::SUCCESS; } private function setStyle(InputInterface $input, OutputInterface $output): void { $this->style = new SymfonyStyle($input, $output); } private function setFilePaths(): void { $this->filePaths = new FilePathCollection([ 'config' => new SpinnerFilePath('config'), ]); } }