@@ -66,7 +66,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6666 }
6767
6868 foreach ($ prefixIcons as $ prefix => $ icons ) {
69-
7069 if (!$ this ->iconify ->hasIconSet ($ prefix )) {
7170 $ io ->error (\sprintf ('Icon set "%s" not found. ' , $ prefix ));
7271 $ result = Command::FAILURE ;
@@ -78,46 +77,45 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7877 $ io ->newLine ();
7978 $ io ->writeln (\sprintf (' Icon set: %s (License: %s) ' , $ metadata ['name ' ], $ metadata ['license ' ]['title ' ]));
8079
81- foreach ($ this ->iconify ->chunk ($ prefix , \array_keys ($ icons )) as $ iconNames ) {
82-
80+ foreach ($ this ->iconify ->chunk ($ prefix , array_keys ($ icons )) as $ iconNames ) {
8381 $ cursor = new Cursor ($ output );
8482 foreach ($ iconNames as $ name ) {
8583 $ io ->writeln (\sprintf (' Importing %s:%s ... ' , $ prefix , $ name ));
8684 }
87- $ cursor ->moveUp (count ($ iconNames ));
85+ $ cursor ->moveUp (\ count ($ iconNames ));
8886
8987 try {
9088 $ batchResults = $ this ->iconify ->fetchIcons ($ prefix , $ iconNames );
9189 } catch (\InvalidArgumentException $ e ) {
9290 // At this point no exception should be thrown
9391 $ io ->error ($ e ->getMessage ());
9492
95- return COMMAND ::FAILURE ;
93+ return Command ::FAILURE ;
9694 }
9795
9896 foreach ($ iconNames as $ name ) {
9997 $ cursor ->clearLineAfter ();
10098
10199 // If the icon is not found, the value will be null
102100 if (null === $ icon = $ batchResults [$ name ] ?? null ) {
103- $ io ->writeln (\sprintf (" <fg=red;options=bold>✗</> Not Found <fg=bright-white;bg=black>%s:</><fg=bright-red;bg=black>%s</> " , $ prefix , $ name ));
101+ $ io ->writeln (\sprintf (' <fg=red;options=bold>✗</> Not Found <fg=bright-white;bg=black>%s:</><fg=bright-red;bg=black>%s</> ' , $ prefix , $ name ));
104102
105103 continue ;
106104 }
107105
108106 ++$ importedIcons ;
109107 $ this ->registry ->add (\sprintf ('%s/%s ' , $ prefix , $ name ), (string ) $ icon );
110- $ io ->writeln (\sprintf (" <fg=bright-green;options=bold>✓</> Imported <fg=bright-white;bg=black>%s:</><fg=bright-magenta;bg=black;options>%s</> " , $ prefix , $ name ));
108+ $ io ->writeln (\sprintf (' <fg=bright-green;options=bold>✓</> Imported <fg=bright-white;bg=black>%s:</><fg=bright-magenta;bg=black;options>%s</> ' , $ prefix , $ name ));
111109 }
112110 }
113111 }
114112
115- if ($ importedIcons === $ totalIcons = count ($ names )) {
116- $ io ->success (sprintf ('Imported %d/%d icons. ' , $ importedIcons , $ totalIcons ));
113+ if ($ importedIcons === $ totalIcons = \ count ($ names )) {
114+ $ io ->success (\ sprintf ('Imported %d/%d icons. ' , $ importedIcons , $ totalIcons ));
117115 } elseif ($ importedIcons > 0 ) {
118- $ io ->warning (sprintf ('Imported %d/%d icons. ' , $ importedIcons , $ totalIcons ));
116+ $ io ->warning (\ sprintf ('Imported %d/%d icons. ' , $ importedIcons , $ totalIcons ));
119117 } else {
120- $ io ->error (sprintf ('Imported %d/%d icons. ' , $ importedIcons , $ totalIcons ));
118+ $ io ->error (\ sprintf ('Imported %d/%d icons. ' , $ importedIcons , $ totalIcons ));
121119 $ result = Command::FAILURE ;
122120 }
123121
0 commit comments