2222use  Doctrine \ORM \EntityManagerInterface ;
2323use  Symfony \Component \Console \Attribute \AsCommand ;
2424use  Symfony \Component \Console \Command \Command ;
25+ use  Symfony \Component \Console \Helper \ProgressIndicator ;
2526use  Symfony \Component \Console \Input \InputInterface ;
2627use  Symfony \Component \Console \Output \OutputInterface ;
2728use  Symfony \Component \Console \Style \SymfonyStyle ;
@@ -38,13 +39,20 @@ protected function execute(InputInterface $input, OutputInterface $output): int
3839    {
3940        $ io  = new  SymfonyStyle ($ input , $ output );
4041
41-         $ this  ->clearEntity (Chat::class, $ io );
42-         $ this  ->clearEntity (TodoItem::class, $ io );
43-         $ this  ->clearEntity (TodoList::class, $ io );
44-         $ this  ->clearEntity (InvoiceItem::class, $ io );
45-         $ this  ->clearEntity (Invoice::class, $ io );
46-         $ this  ->growFood ($ io );
47-         $ this  ->manufactureProducts ($ io );
42+         $ progressIndicator  = new  ProgressIndicator ($ output , finishedIndicatorValue: '✅ ' );
43+         try  {
44+             $ progressIndicator ->start ("Loading data " );
45+             $ this  ->clearEntity (Chat::class, $ io );
46+             $ this  ->clearEntity (TodoItem::class, $ io );
47+             $ this  ->clearEntity (TodoList::class, $ io );
48+             $ this  ->clearEntity (InvoiceItem::class, $ io );
49+             $ this  ->clearEntity (Invoice::class, $ io );
50+             $ this  ->growFood ($ io );
51+             $ this  ->manufactureProducts ($ io );
52+             $ progressIndicator ->finish ('Finished ' );
53+         } catch  (\Exception  ) {
54+             $ progressIndicator ->finish ('Failed ' , '🚨 ' );
55+         }
4856
4957        return  Command::SUCCESS ;
5058    }
0 commit comments