fileUtils->getNode($path); if ($node instanceof Folder) { $output->writeln("$path already exists"); return ExitCode::Success; } if ($node instanceof File) { $output->writeln("$path is a file"); return ExitCode::Failure; } $this->rootFolder->newFolder($path); return ExitCode::Success; } }