Passed
Pull Request — master (#233)
by Pavel
03:51 queued 01:19
created
src/Command/Migrate/AbstractCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      */
42 42
     protected function verifyConfigured(): bool
43 43
     {
44
-        if (!$this->migrator->isConfigured()) {
44
+        if (!$this->migrator->isConfigured()){
45 45
             $this->writeln(
46 46
                 "<fg=red>Migrations are not configured yet, run '<info>migrate:init</info>' first.</fg=red>"
47 47
             );
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
      */
60 60
     protected function verifyEnvironment(): bool
61 61
     {
62
-        if ($this->option('force') || $this->config->isSafe()) {
62
+        if ($this->option('force') || $this->config->isSafe()){
63 63
             //Safe to run
64 64
             return true;
65 65
         }
66 66
 
67 67
         $this->writeln('<fg=red>Confirmation is required to run migrations!</fg=red>');
68 68
 
69
-        if (!$this->askConfirmation()) {
69
+        if (!$this->askConfirmation()){
70 70
             $this->writeln('<comment>Cancelling operation...</comment>');
71 71
 
72 72
             return false;
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,8 @@  discard block
 block discarded – undo
41 41
      */
42 42
     protected function verifyConfigured(): bool
43 43
     {
44
-        if (!$this->migrator->isConfigured()) {
44
+        if (!$this->migrator->isConfigured())
45
+        {
45 46
             $this->writeln(
46 47
                 "<fg=red>Migrations are not configured yet, run '<info>migrate:init</info>' first.</fg=red>"
47 48
             );
@@ -59,14 +60,16 @@  discard block
 block discarded – undo
59 60
      */
60 61
     protected function verifyEnvironment(): bool
61 62
     {
62
-        if ($this->option('force') || $this->config->isSafe()) {
63
+        if ($this->option('force') || $this->config->isSafe())
64
+        {
63 65
             //Safe to run
64 66
             return true;
65 67
         }
66 68
 
67 69
         $this->writeln('<fg=red>Confirmation is required to run migrations!</fg=red>');
68 70
 
69
-        if (!$this->askConfirmation()) {
71
+        if (!$this->askConfirmation())
72
+        {
70 73
             $this->writeln('<comment>Cancelling operation...</comment>');
71 74
 
72 75
             return false;
Please login to merge, or discard this patch.
src/Command/CleanCommand.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,20 +26,20 @@  discard block
 block discarded – undo
26 26
     public function perform(FilesInterface $files, DirectoriesInterface $directories): void
27 27
     {
28 28
         $cacheDirectory = $directories->get('cache');
29
-        if (!$files->exists($cacheDirectory)) {
29
+        if (!$files->exists($cacheDirectory)){
30 30
             $this->writeln('Cache directory is missing, no cache to be cleaned.');
31 31
 
32 32
             return;
33 33
         }
34 34
 
35
-        if ($this->isVerbose()) {
35
+        if ($this->isVerbose()){
36 36
             $this->writeln('<info>Cleaning application cache:</info>');
37 37
         }
38 38
 
39
-        foreach ($files->getFiles($cacheDirectory) as $filename) {
40
-            try {
39
+        foreach ($files->getFiles($cacheDirectory) as $filename){
40
+            try{
41 41
                 $files->delete($filename);
42
-            } catch (\Throwable $e) {
42
+            }catch (\Throwable $e){
43 43
                 // @codeCoverageIgnoreStart
44 44
                 $this->sprintf(
45 45
                     "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n",
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
                 // @codeCoverageIgnoreEnd
52 52
             }
53 53
 
54
-            if ($this->isVerbose()) {
54
+            if ($this->isVerbose()){
55 55
                 $this->sprintf(
56 56
                     "<fg=green>[deleted]</fg=green> `%s`\n",
57 57
                     $files->relativePath($filename, $cacheDirectory)
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -26,20 +26,26 @@  discard block
 block discarded – undo
26 26
     public function perform(FilesInterface $files, DirectoriesInterface $directories): void
27 27
     {
28 28
         $cacheDirectory = $directories->get('cache');
29
-        if (!$files->exists($cacheDirectory)) {
29
+        if (!$files->exists($cacheDirectory))
30
+        {
30 31
             $this->writeln('Cache directory is missing, no cache to be cleaned.');
31 32
 
32 33
             return;
33 34
         }
34 35
 
35
-        if ($this->isVerbose()) {
36
+        if ($this->isVerbose())
37
+        {
36 38
             $this->writeln('<info>Cleaning application cache:</info>');
37 39
         }
38 40
 
39
-        foreach ($files->getFiles($cacheDirectory) as $filename) {
40
-            try {
41
+        foreach ($files->getFiles($cacheDirectory) as $filename)
42
+        {
43
+            try
44
+            {
41 45
                 $files->delete($filename);
42
-            } catch (\Throwable $e) {
46
+            }
47
+            catch (\Throwable $e)
48
+            {
43 49
                 // @codeCoverageIgnoreStart
44 50
                 $this->sprintf(
45 51
                     "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n",
@@ -51,7 +57,8 @@  discard block
 block discarded – undo
51 57
                 // @codeCoverageIgnoreEnd
52 58
             }
53 59
 
54
-            if ($this->isVerbose()) {
60
+            if ($this->isVerbose())
61
+            {
55 62
                 $this->sprintf(
56 63
                     "<fg=green>[deleted]</fg=green> `%s`\n",
57 64
                     $files->relativePath($filename, $cacheDirectory)
Please login to merge, or discard this patch.
src/Command/PublishCommand.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
         FilesInterface $files,
55 55
         DirectoriesInterface $directories
56 56
     ): void {
57
-        switch ($this->argument('type')) {
57
+        switch ($this->argument('type')){
58 58
             case 'replace':
59 59
             case 'follow':
60
-                if ($this->isDirectory()) {
60
+                if ($this->isDirectory()){
61 61
                     $this->sprintf(
62 62
                         '<fg=cyan>•</fg=cyan> publish directory <comment>%s</comment> to <comment>%s</comment>',
63 63
                         $this->getSource($files, $directories),
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
                         $this->getMergeMode(),
71 71
                         $this->getFileMode()
72 72
                     );
73
-                } else {
73
+                }else{
74 74
                     $this->sprintf(
75 75
                         '<fg=cyan>•</fg=cyan> publish file <comment>%s</comment> to <comment>%s</comment>',
76 76
                         $this->getSource($files, $directories),
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
      */
111 111
     private function getSource(FilesInterface $files, DirectoriesInterface $directories): ?string
112 112
     {
113
-        if (!$this->isDirectory()) {
113
+        if (!$this->isDirectory()){
114 114
             return $files->normalizePath($this->argument('source'));
115 115
         }
116 116
 
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     private function getTarget(FilesInterface $files, DirectoriesInterface $directories): ?string
126 126
     {
127 127
         $target = $this->argument('target');
128
-        foreach ($directories->getAll() as $alias => $value) {
128
+        foreach ($directories->getAll() as $alias => $value){
129 129
             $target = str_replace("@{$alias}", $value, $target);
130 130
         }
131 131
 
@@ -137,11 +137,11 @@  discard block
 block discarded – undo
137 137
      */
138 138
     private function isDirectory(): bool
139 139
     {
140
-        if ($this->argument('type') == 'ensure') {
140
+        if ($this->argument('type') == 'ensure'){
141 141
             return true;
142 142
         }
143 143
 
144
-        if (strpos($this->argument('source'), '*') !== false) {
144
+        if (strpos($this->argument('source'), '*') !== false){
145 145
             return true;
146 146
         }
147 147
 
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
      */
154 154
     private function getMergeMode(): string
155 155
     {
156
-        switch ($this->argument('type')) {
156
+        switch ($this->argument('type')){
157 157
             case 'follow':
158 158
                 return PublisherInterface::FOLLOW;
159 159
             case 'replace':
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
      */
169 169
     private function getFileMode(): int
170 170
     {
171
-        switch ($this->argument('mode')) {
171
+        switch ($this->argument('mode')){
172 172
             case 'readonly':
173 173
                 return FilesInterface::READONLY;
174 174
             case 'runtime':
Please login to merge, or discard this patch.
Braces   +19 added lines, -9 removed lines patch added patch discarded remove patch
@@ -54,10 +54,12 @@  discard block
 block discarded – undo
54 54
         FilesInterface $files,
55 55
         DirectoriesInterface $directories
56 56
     ): void {
57
-        switch ($this->argument('type')) {
57
+        switch ($this->argument('type'))
58
+        {
58 59
             case 'replace':
59 60
             case 'follow':
60
-                if ($this->isDirectory()) {
61
+                if ($this->isDirectory())
62
+                {
61 63
                     $this->sprintf(
62 64
                         '<fg=cyan>•</fg=cyan> publish directory <comment>%s</comment> to <comment>%s</comment>',
63 65
                         $this->getSource($files, $directories),
@@ -70,7 +72,9 @@  discard block
 block discarded – undo
70 72
                         $this->getMergeMode(),
71 73
                         $this->getFileMode()
72 74
                     );
73
-                } else {
75
+                }
76
+                else
77
+                {
74 78
                     $this->sprintf(
75 79
                         '<fg=cyan>•</fg=cyan> publish file <comment>%s</comment> to <comment>%s</comment>',
76 80
                         $this->getSource($files, $directories),
@@ -110,7 +114,8 @@  discard block
 block discarded – undo
110 114
      */
111 115
     private function getSource(FilesInterface $files, DirectoriesInterface $directories): ?string
112 116
     {
113
-        if (!$this->isDirectory()) {
117
+        if (!$this->isDirectory())
118
+        {
114 119
             return $files->normalizePath($this->argument('source'));
115 120
         }
116 121
 
@@ -125,7 +130,8 @@  discard block
 block discarded – undo
125 130
     private function getTarget(FilesInterface $files, DirectoriesInterface $directories): ?string
126 131
     {
127 132
         $target = $this->argument('target');
128
-        foreach ($directories->getAll() as $alias => $value) {
133
+        foreach ($directories->getAll() as $alias => $value)
134
+        {
129 135
             $target = str_replace("@{$alias}", $value, $target);
130 136
         }
131 137
 
@@ -137,11 +143,13 @@  discard block
 block discarded – undo
137 143
      */
138 144
     private function isDirectory(): bool
139 145
     {
140
-        if ($this->argument('type') == 'ensure') {
146
+        if ($this->argument('type') == 'ensure')
147
+        {
141 148
             return true;
142 149
         }
143 150
 
144
-        if (strpos($this->argument('source'), '*') !== false) {
151
+        if (strpos($this->argument('source'), '*') !== false)
152
+        {
145 153
             return true;
146 154
         }
147 155
 
@@ -153,7 +161,8 @@  discard block
 block discarded – undo
153 161
      */
154 162
     private function getMergeMode(): string
155 163
     {
156
-        switch ($this->argument('type')) {
164
+        switch ($this->argument('type'))
165
+        {
157 166
             case 'follow':
158 167
                 return PublisherInterface::FOLLOW;
159 168
             case 'replace':
@@ -168,7 +177,8 @@  discard block
 block discarded – undo
168 177
      */
169 178
     private function getFileMode(): int
170 179
     {
171
-        switch ($this->argument('mode')) {
180
+        switch ($this->argument('mode'))
181
+        {
172 182
             case 'readonly':
173 183
                 return FilesInterface::READONLY;
174 184
             case 'runtime':
Please login to merge, or discard this patch.
src/Command/Views/ResetCommand.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,20 +27,20 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function perform(ViewsConfig $config, FilesInterface $files): void
29 29
     {
30
-        if (!$files->exists($config->getCacheDirectory())) {
30
+        if (!$files->exists($config->getCacheDirectory())){
31 31
             $this->writeln('Cache directory is missing, no cache to be cleaned.');
32 32
 
33 33
             return;
34 34
         }
35 35
 
36
-        if ($this->isVerbose()) {
36
+        if ($this->isVerbose()){
37 37
             $this->writeln('<info>Cleaning view cache:</info>');
38 38
         }
39 39
 
40
-        foreach ($files->getFiles($config->getCacheDirectory()) as $filename) {
41
-            try {
40
+        foreach ($files->getFiles($config->getCacheDirectory()) as $filename){
41
+            try{
42 42
                 $files->delete($filename);
43
-            } catch (\Throwable $e) {
43
+            }catch (\Throwable $e){
44 44
                 // @codeCoverageIgnoreStart
45 45
                 $this->sprintf(
46 46
                     "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n",
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
                 // @codeCoverageIgnoreEnd
54 54
             }
55 55
 
56
-            if ($this->isVerbose()) {
56
+            if ($this->isVerbose()){
57 57
                 $this->sprintf(
58 58
                     "<fg=green>[deleted]</fg=green> `%s`\n",
59 59
                     $files->relativePath($filename, $config->getCacheDirectory())
Please login to merge, or discard this patch.
Braces   +13 added lines, -6 removed lines patch added patch discarded remove patch
@@ -27,20 +27,26 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function perform(ViewsConfig $config, FilesInterface $files): void
29 29
     {
30
-        if (!$files->exists($config->getCacheDirectory())) {
30
+        if (!$files->exists($config->getCacheDirectory()))
31
+        {
31 32
             $this->writeln('Cache directory is missing, no cache to be cleaned.');
32 33
 
33 34
             return;
34 35
         }
35 36
 
36
-        if ($this->isVerbose()) {
37
+        if ($this->isVerbose())
38
+        {
37 39
             $this->writeln('<info>Cleaning view cache:</info>');
38 40
         }
39 41
 
40
-        foreach ($files->getFiles($config->getCacheDirectory()) as $filename) {
41
-            try {
42
+        foreach ($files->getFiles($config->getCacheDirectory()) as $filename)
43
+        {
44
+            try
45
+            {
42 46
                 $files->delete($filename);
43
-            } catch (\Throwable $e) {
47
+            }
48
+            catch (\Throwable $e)
49
+            {
44 50
                 // @codeCoverageIgnoreStart
45 51
                 $this->sprintf(
46 52
                     "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n",
@@ -53,7 +59,8 @@  discard block
 block discarded – undo
53 59
                 // @codeCoverageIgnoreEnd
54 60
             }
55 61
 
56
-            if ($this->isVerbose()) {
62
+            if ($this->isVerbose())
63
+            {
57 64
                 $this->sprintf(
58 65
                     "<fg=green>[deleted]</fg=green> `%s`\n",
59 66
                     $files->relativePath($filename, $config->getCacheDirectory())
Please login to merge, or discard this patch.
src/Command/Translator/ExportCommand.php 2 patches
Braces   +12 added lines, -6 removed lines patch added patch discarded remove patch
@@ -39,7 +39,8 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function perform(TranslatorConfig $config, CatalogueManager $manager): void
41 41
     {
42
-        if (!$config->hasDumper($this->option('dumper'))) {
42
+        if (!$config->hasDumper($this->option('dumper')))
43
+        {
43 44
             $this->writeln("<fg=red>Undefined dumper '{$this->option('dumper')}'.</fg=red>");
44 45
 
45 46
             return;
@@ -51,7 +52,8 @@  discard block
 block discarded – undo
51 52
             $manager->get($this->argument('locale'))
52 53
         );
53 54
 
54
-        if ($this->isVerbose() && !empty($mc->getDomains())) {
55
+        if ($this->isVerbose() && !empty($mc->getDomains()))
56
+        {
55 57
             $this->sprintf(
56 58
                 "<info>Exporting domain(s):</info> %s\n",
57 59
                 join(',', $mc->getDomains())
@@ -86,10 +88,14 @@  discard block
 block discarded – undo
86 88
             $catalogue->getData()
87 89
         );
88 90
 
89
-        if ($this->option('fallback')) {
90
-            foreach ($manager->get($config->getFallbackLocale())->getData() as $domain => $messages) {
91
-                foreach ($messages as $id => $message) {
92
-                    if (!$messageCatalogue->defines($id, $domain)) {
91
+        if ($this->option('fallback'))
92
+        {
93
+            foreach ($manager->get($config->getFallbackLocale())->getData() as $domain => $messages)
94
+            {
95
+                foreach ($messages as $id => $message)
96
+                {
97
+                    if (!$messageCatalogue->defines($id, $domain))
98
+                    {
93 99
                         $messageCatalogue->set($id, $message, $domain);
94 100
                     }
95 101
                 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
         ['locale', InputArgument::REQUIRED, 'Locale to be dumped'],
29 29
         ['path', InputArgument::REQUIRED, 'Export path']
30 30
     ];
31
-    protected const OPTIONS     = [
31
+    protected const OPTIONS = [
32 32
         ['dumper', 'd', InputOption::VALUE_OPTIONAL, 'Dumper name', 'php'],
33 33
         ['fallback', 'f', InputOption::VALUE_NONE, 'Merge messages from fallback catalogue'],
34 34
     ];
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
      */
40 40
     public function perform(TranslatorConfig $config, CatalogueManager $manager): void
41 41
     {
42
-        if (!$config->hasDumper($this->option('dumper'))) {
42
+        if (!$config->hasDumper($this->option('dumper'))){
43 43
             $this->writeln("<fg=red>Undefined dumper '{$this->option('dumper')}'.</fg=red>");
44 44
 
45 45
             return;
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
             $manager->get($this->argument('locale'))
52 52
         );
53 53
 
54
-        if ($this->isVerbose() && !empty($mc->getDomains())) {
54
+        if ($this->isVerbose() && !empty($mc->getDomains())){
55 55
             $this->sprintf(
56 56
                 "<info>Exporting domain(s):</info> %s\n",
57 57
                 join(',', $mc->getDomains())
@@ -69,8 +69,8 @@  discard block
 block discarded – undo
69 69
             ]
70 70
         );
71 71
 
72
-        $this->writeln('Export successfully completed using <info>' . get_class($dumper) . '</info>');
73
-        $this->writeln('Output: <comment>' . realpath($this->argument('path')) . '</comment>');
72
+        $this->writeln('Export successfully completed using <info>'.get_class($dumper).'</info>');
73
+        $this->writeln('Output: <comment>'.realpath($this->argument('path')).'</comment>');
74 74
     }
75 75
 
76 76
     /**
@@ -89,10 +89,10 @@  discard block
 block discarded – undo
89 89
             $catalogue->getData()
90 90
         );
91 91
 
92
-        if ($this->option('fallback')) {
93
-            foreach ($manager->get($config->getFallbackLocale())->getData() as $domain => $messages) {
94
-                foreach ($messages as $id => $message) {
95
-                    if (!$messageCatalogue->defines($id, $domain)) {
92
+        if ($this->option('fallback')){
93
+            foreach ($manager->get($config->getFallbackLocale())->getData() as $domain => $messages){
94
+                foreach ($messages as $id => $message){
95
+                    if (!$messageCatalogue->defines($id, $domain)){
96 96
                         $messageCatalogue->set($id, $message, $domain);
97 97
                     }
98 98
                 }
Please login to merge, or discard this patch.
src/Command/Cycle/MigrateCommand.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,12 +56,12 @@  discard block
 block discarded – undo
56 56
         Migrator $migrator,
57 57
         Console $console
58 58
     ): void {
59
-        if (!$this->verifyConfigured()) {
59
+        if (!$this->verifyConfigured()){
60 60
             return;
61 61
         }
62 62
 
63
-        foreach ($migrator->getMigrations() as $migration) {
64
-            if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED) {
63
+        foreach ($migrator->getMigrations() as $migration){
64
+            if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED){
65 65
                 $this->writeln('<fg=red>Outstanding migrations found, run `migrate` first.</fg=red>');
66 66
                 return;
67 67
             }
@@ -76,10 +76,10 @@  discard block
 block discarded – undo
76 76
 
77 77
         $memory->saveData('cycle', $schema);
78 78
 
79
-        if ($show->hasChanges()) {
79
+        if ($show->hasChanges()){
80 80
             (new Compiler())->compile($registry, [$migrations]);
81 81
 
82
-            if ($this->option('run')) {
82
+            if ($this->option('run')){
83 83
                 $console->run('migrate', [], $this->output);
84 84
             }
85 85
         }
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -56,12 +56,15 @@  discard block
 block discarded – undo
56 56
         Migrator $migrator,
57 57
         Console $console
58 58
     ): void {
59
-        if (!$this->verifyConfigured()) {
59
+        if (!$this->verifyConfigured())
60
+        {
60 61
             return;
61 62
         }
62 63
 
63
-        foreach ($migrator->getMigrations() as $migration) {
64
-            if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED) {
64
+        foreach ($migrator->getMigrations() as $migration)
65
+        {
66
+            if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED)
67
+            {
65 68
                 $this->writeln('<fg=red>Outstanding migrations found, run `migrate` first.</fg=red>');
66 69
                 return;
67 70
             }
@@ -76,10 +79,12 @@  discard block
 block discarded – undo
76 79
 
77 80
         $memory->saveData('cycle', $schema);
78 81
 
79
-        if ($show->hasChanges()) {
82
+        if ($show->hasChanges())
83
+        {
80 84
             (new Compiler())->compile($registry, [$migrations]);
81 85
 
82
-            if ($this->option('run')) {
86
+            if ($this->option('run'))
87
+            {
83 88
                 $console->run('migrate', [], $this->output);
84 89
             }
85 90
         }
Please login to merge, or discard this patch.
src/Command/Views/CompileCommand.php 2 patches
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
         $generator = new ContextGenerator($views->getContext());
35 35
 
36 36
         $contexts = $generator->generate();
37
-        if (empty($contexts)) {
37
+        if (empty($contexts)){
38 38
             $contexts[] = $views->getContext();
39 39
         }
40 40
 
41
-        foreach ($contexts as $context) {
42
-            foreach ($views->getEngines() as $engine) {
43
-                if ($engine instanceof NativeEngine) {
41
+        foreach ($contexts as $context){
42
+            foreach ($views->getEngines() as $engine){
43
+                if ($engine instanceof NativeEngine){
44 44
                     // no need to compile
45 45
                     continue;
46 46
                 }
@@ -64,19 +64,19 @@  discard block
 block discarded – undo
64 64
             $this->describeContext($context) ?? 'default'
65 65
         );
66 66
 
67
-        foreach ($engine->getLoader()->list() as $path) {
67
+        foreach ($engine->getLoader()->list() as $path){
68 68
             $start = microtime(true);
69
-            try {
69
+            try{
70 70
                 $engine->reset($path, $context);
71 71
                 $engine->compile($path, $context);
72 72
 
73
-                if ($this->isVerbose()) {
73
+                if ($this->isVerbose()){
74 74
                     $this->sprintf('<info>•</info> %s', $path);
75 75
                 }
76
-            } catch (\Throwable $e) {
76
+            }catch (\Throwable $e){
77 77
                 $this->renderError($path, $e);
78 78
                 continue;
79
-            } finally {
79
+            }finally{
80 80
                 $this->renderElapsed($start);
81 81
             }
82 82
         }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
      */
91 91
     protected function renderError(string $path, \Throwable $e): void
92 92
     {
93
-        if (!$this->isVerbose()) {
93
+        if (!$this->isVerbose()){
94 94
             return;
95 95
         }
96 96
 
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
     {
111 111
         $values = [];
112 112
 
113
-        foreach ($context->getDependencies() as $dependency) {
113
+        foreach ($context->getDependencies() as $dependency){
114 114
             $values[] = sprintf(
115 115
                 '%s%s%s:%s%s%s',
116 116
                 Color::LIGHT_WHITE,
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
      */
142 142
     private function renderSuccess(string $lastPath = null): void
143 143
     {
144
-        if (!$this->isVerbose()) {
144
+        if (!$this->isVerbose()){
145 145
             return;
146 146
         }
147 147
 
148
-        if ($lastPath === null) {
148
+        if ($lastPath === null){
149 149
             $this->writeln('• no views found');
150 150
         }
151 151
 
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
      */
158 158
     private function renderElapsed(float $start): void
159 159
     {
160
-        if (!$this->isVerbose()) {
160
+        if (!$this->isVerbose()){
161 161
             return;
162 162
         }
163 163
 
Please login to merge, or discard this patch.
Braces   +30 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,13 +34,17 @@  discard block
 block discarded – undo
34 34
         $generator = new ContextGenerator($views->getContext());
35 35
 
36 36
         $contexts = $generator->generate();
37
-        if (empty($contexts)) {
37
+        if (empty($contexts))
38
+        {
38 39
             $contexts[] = $views->getContext();
39 40
         }
40 41
 
41
-        foreach ($contexts as $context) {
42
-            foreach ($views->getEngines() as $engine) {
43
-                if ($engine instanceof NativeEngine) {
42
+        foreach ($contexts as $context)
43
+        {
44
+            foreach ($views->getEngines() as $engine)
45
+            {
46
+                if ($engine instanceof NativeEngine)
47
+                {
44 48
                     // no need to compile
45 49
                     continue;
46 50
                 }
@@ -64,19 +68,26 @@  discard block
 block discarded – undo
64 68
             $this->describeContext($context) ?? 'default'
65 69
         );
66 70
 
67
-        foreach ($engine->getLoader()->list() as $path) {
71
+        foreach ($engine->getLoader()->list() as $path)
72
+        {
68 73
             $start = microtime(true);
69
-            try {
74
+            try
75
+            {
70 76
                 $engine->reset($path, $context);
71 77
                 $engine->compile($path, $context);
72 78
 
73
-                if ($this->isVerbose()) {
79
+                if ($this->isVerbose())
80
+                {
74 81
                     $this->sprintf('<info>•</info> %s', $path);
75 82
                 }
76
-            } catch (\Throwable $e) {
83
+            }
84
+            catch (\Throwable $e)
85
+            {
77 86
                 $this->renderError($path, $e);
78 87
                 continue;
79
-            } finally {
88
+            }
89
+            finally
90
+            {
80 91
                 $this->renderElapsed($start);
81 92
             }
82 93
         }
@@ -90,7 +101,8 @@  discard block
 block discarded – undo
90 101
      */
91 102
     protected function renderError(string $path, \Throwable $e): void
92 103
     {
93
-        if (!$this->isVerbose()) {
104
+        if (!$this->isVerbose())
105
+        {
94 106
             return;
95 107
         }
96 108
 
@@ -110,7 +122,8 @@  discard block
 block discarded – undo
110 122
     {
111 123
         $values = [];
112 124
 
113
-        foreach ($context->getDependencies() as $dependency) {
125
+        foreach ($context->getDependencies() as $dependency)
126
+        {
114 127
             $values[] = sprintf(
115 128
                 '%s%s%s:%s%s%s',
116 129
                 Color::LIGHT_WHITE,
@@ -141,11 +154,13 @@  discard block
 block discarded – undo
141 154
      */
142 155
     private function renderSuccess(string $lastPath = null): void
143 156
     {
144
-        if (!$this->isVerbose()) {
157
+        if (!$this->isVerbose())
158
+        {
145 159
             return;
146 160
         }
147 161
 
148
-        if ($lastPath === null) {
162
+        if ($lastPath === null)
163
+        {
149 164
             $this->writeln('• no views found');
150 165
         }
151 166
 
@@ -157,7 +172,8 @@  discard block
 block discarded – undo
157 172
      */
158 173
     private function renderElapsed(float $start): void
159 174
     {
160
-        if (!$this->isVerbose()) {
175
+        if (!$this->isVerbose())
176
+        {
161 177
             return;
162 178
         }
163 179
 
Please login to merge, or discard this patch.
src/Command/Migrate/ReplayCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function perform(Console $console): void
29 29
     {
30
-        if (!$this->verifyEnvironment()) {
30
+        if (!$this->verifyEnvironment()){
31 31
             //Making sure we can safely migrate in this environment
32 32
             return;
33 33
         }
@@ -35,9 +35,9 @@  discard block
 block discarded – undo
35 35
         $rollback = ['--force' => true];
36 36
         $migrate = ['--force' => true];
37 37
 
38
-        if ($this->option('all')) {
38
+        if ($this->option('all')){
39 39
             $rollback['--all'] = true;
40
-        } else {
40
+        }else{
41 41
             $migrate['--one'] = true;
42 42
         }
43 43
 
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
      */
28 28
     public function perform(Console $console): void
29 29
     {
30
-        if (!$this->verifyEnvironment()) {
30
+        if (!$this->verifyEnvironment())
31
+        {
31 32
             //Making sure we can safely migrate in this environment
32 33
             return;
33 34
         }
@@ -35,9 +36,12 @@  discard block
 block discarded – undo
35 36
         $rollback = ['--force' => true];
36 37
         $migrate = ['--force' => true];
37 38
 
38
-        if ($this->option('all')) {
39
+        if ($this->option('all'))
40
+        {
39 41
             $rollback['--all'] = true;
40
-        } else {
42
+        }
43
+        else
44
+        {
41 45
             $migrate['--one'] = true;
42 46
         }
43 47
 
Please login to merge, or discard this patch.
src/Command/GRPC/GenerateCommand.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function perform(KernelInterface $kernel, FilesInterface $files, DirectoriesInterface $dirs): void
41 41
     {
42 42
         $protoFile = $this->argument('proto');
43
-        if (!file_exists($protoFile)) {
43
+        if (!file_exists($protoFile)){
44 44
             $this->sprintf('<error>File `%s` not found.</error>', $protoFile);
45 45
             return;
46 46
         }
@@ -53,19 +53,19 @@  discard block
 block discarded – undo
53 53
 
54 54
         $this->sprintf("<info>Compiling <fg=cyan>`%s`</fg=cyan>:</info>\n", $protoFile);
55 55
 
56
-        try {
56
+        try{
57 57
             $result = $compiler->compile($protoFile);
58
-        } catch (\Throwable $e) {
58
+        }catch (\Throwable $e){
59 59
             $this->sprintf("<error>Error:</error> <fg=red>%s</fg=red>\n", $e->getMessage());
60 60
             return;
61 61
         }
62 62
 
63
-        if ($result === []) {
63
+        if ($result === []){
64 64
             $this->sprintf("<info>No files were generated.</info>\n", $protoFile);
65 65
             return;
66 66
         }
67 67
 
68
-        foreach ($result as $file) {
68
+        foreach ($result as $file){
69 69
             $this->sprintf(
70 70
                 "<fg=green>•</fg=green> %s%s%s\n",
71 71
                 Color::LIGHT_WHITE,
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     protected function getPath(KernelInterface $kernel): string
85 85
     {
86 86
         $path = $this->argument('namespace');
87
-        if ($path !== 'auto') {
87
+        if ($path !== 'auto'){
88 88
             return $path;
89 89
         }
90 90
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     protected function getNamespace(KernelInterface $kernel): string
103 103
     {
104 104
         $namespace = $this->argument('namespace');
105
-        if ($namespace !== 'auto') {
105
+        if ($namespace !== 'auto'){
106 106
             return $namespace;
107 107
         }
108 108
 
Please login to merge, or discard this patch.
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@  discard block
 block discarded – undo
40 40
     public function perform(KernelInterface $kernel, FilesInterface $files, DirectoriesInterface $dirs): void
41 41
     {
42 42
         $protoFile = $this->argument('proto');
43
-        if (!file_exists($protoFile)) {
43
+        if (!file_exists($protoFile))
44
+        {
44 45
             $this->sprintf('<error>File `%s` not found.</error>', $protoFile);
45 46
             return;
46 47
         }
@@ -53,19 +54,24 @@  discard block
 block discarded – undo
53 54
 
54 55
         $this->sprintf("<info>Compiling <fg=cyan>`%s`</fg=cyan>:</info>\n", $protoFile);
55 56
 
56
-        try {
57
+        try
58
+        {
57 59
             $result = $compiler->compile($protoFile);
58
-        } catch (\Throwable $e) {
60
+        }
61
+        catch (\Throwable $e)
62
+        {
59 63
             $this->sprintf("<error>Error:</error> <fg=red>%s</fg=red>\n", $e->getMessage());
60 64
             return;
61 65
         }
62 66
 
63
-        if ($result === []) {
67
+        if ($result === [])
68
+        {
64 69
             $this->sprintf("<info>No files were generated.</info>\n", $protoFile);
65 70
             return;
66 71
         }
67 72
 
68
-        foreach ($result as $file) {
73
+        foreach ($result as $file)
74
+        {
69 75
             $this->sprintf(
70 76
                 "<fg=green>•</fg=green> %s%s%s\n",
71 77
                 Color::LIGHT_WHITE,
@@ -84,7 +90,8 @@  discard block
 block discarded – undo
84 90
     protected function getPath(KernelInterface $kernel): string
85 91
     {
86 92
         $path = $this->argument('namespace');
87
-        if ($path !== 'auto') {
93
+        if ($path !== 'auto')
94
+        {
88 95
             return $path;
89 96
         }
90 97
 
@@ -102,7 +109,8 @@  discard block
 block discarded – undo
102 109
     protected function getNamespace(KernelInterface $kernel): string
103 110
     {
104 111
         $namespace = $this->argument('namespace');
105
-        if ($namespace !== 'auto') {
112
+        if ($namespace !== 'auto')
113
+        {
106 114
             return $namespace;
107 115
         }
108 116
 
Please login to merge, or discard this patch.