@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | |
80 | 80 | $callback = function($name) use ($output, &$failedInstances) |
81 | 81 | { |
82 | - try{ |
|
82 | + try { |
|
83 | 83 | if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { |
84 | 84 | $output->writeln("<fg=yellow>Clearing instance {$name} cache...</>"); |
85 | 85 | } |
@@ -87,11 +87,11 @@ discard block |
||
87 | 87 | if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { |
88 | 88 | $output->writeln("<fg=green>Cache instance {$name} cleared</>"); |
89 | 89 | } |
90 | - }catch (PhpfastcacheDriverCheckException $e){ |
|
90 | + } catch (PhpfastcacheDriverCheckException $e) { |
|
91 | 91 | $failedInstances[] = $name; |
92 | 92 | if (OutputInterface::VERBOSITY_VERBOSE <= $output->getVerbosity()) { |
93 | - $output->writeln("<fg=red>Cache instance {$name} not cleared, got exception: " . "<bg=red;options=bold>" . $e->getMessage() ."</>"); |
|
94 | - }else{ |
|
93 | + $output->writeln("<fg=red>Cache instance {$name} not cleared, got exception: " . "<bg=red;options=bold>" . $e->getMessage() . "</>"); |
|
94 | + } else { |
|
95 | 95 | $output->writeln("<fg=red>Cache instance {$name} not cleared (increase verbosity to get more information).</>"); |
96 | 96 | } |
97 | 97 | } |
@@ -99,24 +99,24 @@ discard block |
||
99 | 99 | |
100 | 100 | $caches = $this->parameters; |
101 | 101 | |
102 | - if($driver) { |
|
103 | - if(\array_key_exists($driver, $caches['drivers'])){ |
|
102 | + if ($driver) { |
|
103 | + if (\array_key_exists($driver, $caches['drivers'])) { |
|
104 | 104 | $callback($driver); |
105 | - if(!\count($failedInstances)){ |
|
105 | + if (!\count($failedInstances)) { |
|
106 | 106 | $io->success("Cache instance {$driver} cleared"); |
107 | - }else{ |
|
107 | + } else { |
|
108 | 108 | $io->error("Cache instance {$driver} not cleared"); |
109 | 109 | } |
110 | - }else{ |
|
110 | + } else { |
|
111 | 111 | $io->error("Cache instance {$driver} does not exists"); |
112 | 112 | } |
113 | 113 | } else { |
114 | - foreach($caches['drivers'] as $name => $parameters) { |
|
114 | + foreach ($caches['drivers'] as $name => $parameters) { |
|
115 | 115 | $callback($name); |
116 | 116 | } |
117 | - if(!\count($failedInstances)){ |
|
117 | + if (!\count($failedInstances)) { |
|
118 | 118 | $io->success('All caches instances got cleared'); |
119 | - }else{ |
|
119 | + } else { |
|
120 | 120 | $io->success('Almost all caches instances got cleared, except these: ' . \implode(', ', $failedInstances)); |
121 | 121 | } |
122 | 122 | } |