diff --git a/.gitignore b/.gitignore index fc9eee1..c78fc6d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,9 +10,10 @@ .DS_Store # Testing @ QA -/.php-cs-fixer.cache -/.php-cs-fixer.php -/.phpunit.result.cache +.php-cs-fixer.cache +.php-cs-fixer.php +.phpunit.result.cache +.codacy/logs/ # Environment /.env @@ -20,7 +21,7 @@ /.codacy # Documentation -/venv/** -/.cache/** -/site - +venv/** +.cache/** +site/** +.DS_Store diff --git a/src/EduFramework/Commands/CreateApiCommand.php b/src/EduFramework/Commands/CreateApiCommand.php index 0e2ebe4..488ed62 100644 --- a/src/EduFramework/Commands/CreateApiCommand.php +++ b/src/EduFramework/Commands/CreateApiCommand.php @@ -46,7 +46,7 @@ class CreateApiCommand extends Command protected function configure(): void { - $this->AddArgument('controller-name', InputArgument::REQUIRED, 'Controller name'); + $this->addArgument('controller-name', InputArgument::REQUIRED, 'Controller name'); } /** diff --git a/src/EduFramework/Commands/CreateCliCommand.php b/src/EduFramework/Commands/CreateCliCommand.php index c411904..9567b5d 100644 --- a/src/EduFramework/Commands/CreateCliCommand.php +++ b/src/EduFramework/Commands/CreateCliCommand.php @@ -44,7 +44,7 @@ class CreateCliCommand extends Command protected function configure(): void { - $this->AddArgument('command-name', InputArgument::REQUIRED, 'Commande name'); + $this->addArgument('command-name', InputArgument::REQUIRED, 'Commande name'); } /** diff --git a/src/EduFramework/Commands/CreateControllerCommand.php b/src/EduFramework/Commands/CreateControllerCommand.php index d2e5799..3d57a73 100644 --- a/src/EduFramework/Commands/CreateControllerCommand.php +++ b/src/EduFramework/Commands/CreateControllerCommand.php @@ -47,7 +47,7 @@ class CreateControllerCommand extends Command protected function configure(): void { - $this->AddArgument('controller-name', InputArgument::REQUIRED, 'Controller name'); + $this->addArgument('controller-name', InputArgument::REQUIRED, 'Controller name'); } /** @@ -63,7 +63,7 @@ public function execute(InputInterface $input, OutputInterface $output): int $io = new SymfonyStyle($input, $output); //Format controller-name arg - $namesCollection = self::getNamesCollection($input->getArgument('controller-name')); + $namesCollection = $this->getNamesCollection($input->getArgument('controller-name')); //Generate route params in app/Config/routes.yaml $this->generateRoute($namesCollection["uri"], $namesCollection["uri"], $namesCollection["className"]); //Generate Controller Class diff --git a/src/EduFramework/Commands/StartCommand.php b/src/EduFramework/Commands/StartCommand.php index 6d653cc..3060ee8 100644 --- a/src/EduFramework/Commands/StartCommand.php +++ b/src/EduFramework/Commands/StartCommand.php @@ -83,14 +83,20 @@ protected function execute(InputInterface $input, ConsoleOutputInterface|OutputI $port = $input->getOption('port'); $noCheck = $input->getOption('no-start'); - if ($noCheck === false && $output instanceof ConsoleOutputInterface) { - $animationSlash = $output->section(); + if ($noCheck === false) { + // Calcule le nombre de lignes de la bannière (ajuste si nécessaire) + $bannerLines = count(explode("\n", CommandBanner::getBanner(0))); for ($slash = 0; $slash <= 5; $slash++) { - $animationSlash->writeln([ + if ($slash > 0) { + // Efface uniquement les lignes de la bannière précédente + for ($i = 0; $i < $bannerLines; $i++) { + $output->write("\033[1A\033[2K"); // Remonte d'une ligne et efface + } + } + $output->writeln([ CommandBanner::getBanner($slash) ]); usleep(500000); // (0.5 seconde) - $slash < 5 ? $animationSlash->clear() : ""; } } diff --git a/src/EduFramework/Core/Controller/Request.php b/src/EduFramework/Core/Controller/Request.php index 95f4d75..99c1ccf 100644 --- a/src/EduFramework/Core/Controller/Request.php +++ b/src/EduFramework/Core/Controller/Request.php @@ -36,7 +36,7 @@ class Request * Nom de la classe du controller * @var string $hander */ - private string $hander; + private string $hander = ''; /** * Les variables de la requête HTTP