Trusted97/whitecat

View on GitHub
src/Command/GithubInitCommand.php

Summary

Maintainability
A
40 mins
Test Coverage
<?php

namespace Whitecat\Command;

use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Filesystem\Filesystem;
use Whitecat\Service\GithubInitService;

#[AsCommand(
    name: 'github:init',
    description: 'Generate basic Github directory with starter files',
    hidden: false
)]
class GithubInitCommand extends Command
{
    protected function execute(InputInterface $input, OutputInterface $output): int
    {
        $io = new SymfonyStyle($input, $output);
        $fs = new Filesystem();

        return (new GithubInitService($io, $fs))->run();
    }
}