@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public function perform(KernelInterface $kernel, FilesInterface $files, DirectoriesInterface $dirs): void |
| 38 | 38 | { |
| 39 | 39 | $protoFile = $this->argument('proto'); |
| 40 | - if (!file_exists($protoFile)) { |
|
| 40 | + if (!file_exists($protoFile)){ |
|
| 41 | 41 | $this->sprintf('<error>File `%s` not found.</error>', $protoFile); |
| 42 | 42 | return; |
| 43 | 43 | } |
@@ -50,19 +50,19 @@ discard block |
||
| 50 | 50 | |
| 51 | 51 | $this->sprintf("<info>Compiling <fg=cyan>`%s`</fg=cyan>:</info>\n", $protoFile); |
| 52 | 52 | |
| 53 | - try { |
|
| 53 | + try{ |
|
| 54 | 54 | $result = $compiler->compile($protoFile); |
| 55 | - } catch (\Throwable $e) { |
|
| 55 | + }catch (\Throwable $e){ |
|
| 56 | 56 | $this->sprintf("<error>Error:</error> <fg=red>%s</fg=red>\n", $e->getMessage()); |
| 57 | 57 | return; |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - if ($result === []) { |
|
| 60 | + if ($result === []){ |
|
| 61 | 61 | $this->sprintf("<info>No files were generated.</info>\n", $protoFile); |
| 62 | 62 | return; |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | - foreach ($result as $file) { |
|
| 65 | + foreach ($result as $file){ |
|
| 66 | 66 | $this->sprintf( |
| 67 | 67 | "<fg=green>•</fg=green> %s%s%s\n", |
| 68 | 68 | Color::LIGHT_WHITE, |
@@ -81,7 +81,7 @@ discard block |
||
| 81 | 81 | protected function getPath(KernelInterface $kernel): string |
| 82 | 82 | { |
| 83 | 83 | $path = $this->argument('path'); |
| 84 | - if ($path !== 'auto') { |
|
| 84 | + if ($path !== 'auto'){ |
|
| 85 | 85 | return $path; |
| 86 | 86 | } |
| 87 | 87 | |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | protected function getNamespace(KernelInterface $kernel): string |
| 100 | 100 | { |
| 101 | 101 | $namespace = $this->argument('namespace'); |
| 102 | - if ($namespace !== 'auto') { |
|
| 102 | + if ($namespace !== 'auto'){ |
|
| 103 | 103 | return $namespace; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -37,7 +37,8 @@ discard block |
||
| 37 | 37 | public function perform(KernelInterface $kernel, FilesInterface $files, DirectoriesInterface $dirs): void |
| 38 | 38 | { |
| 39 | 39 | $protoFile = $this->argument('proto'); |
| 40 | - if (!file_exists($protoFile)) { |
|
| 40 | + if (!file_exists($protoFile)) |
|
| 41 | + { |
|
| 41 | 42 | $this->sprintf('<error>File `%s` not found.</error>', $protoFile); |
| 42 | 43 | return; |
| 43 | 44 | } |
@@ -50,19 +51,24 @@ discard block |
||
| 50 | 51 | |
| 51 | 52 | $this->sprintf("<info>Compiling <fg=cyan>`%s`</fg=cyan>:</info>\n", $protoFile); |
| 52 | 53 | |
| 53 | - try { |
|
| 54 | + try |
|
| 55 | + { |
|
| 54 | 56 | $result = $compiler->compile($protoFile); |
| 55 | - } catch (\Throwable $e) { |
|
| 57 | + } |
|
| 58 | + catch (\Throwable $e) |
|
| 59 | + { |
|
| 56 | 60 | $this->sprintf("<error>Error:</error> <fg=red>%s</fg=red>\n", $e->getMessage()); |
| 57 | 61 | return; |
| 58 | 62 | } |
| 59 | 63 | |
| 60 | - if ($result === []) { |
|
| 64 | + if ($result === []) |
|
| 65 | + { |
|
| 61 | 66 | $this->sprintf("<info>No files were generated.</info>\n", $protoFile); |
| 62 | 67 | return; |
| 63 | 68 | } |
| 64 | 69 | |
| 65 | - foreach ($result as $file) { |
|
| 70 | + foreach ($result as $file) |
|
| 71 | + { |
|
| 66 | 72 | $this->sprintf( |
| 67 | 73 | "<fg=green>•</fg=green> %s%s%s\n", |
| 68 | 74 | Color::LIGHT_WHITE, |
@@ -81,7 +87,8 @@ discard block |
||
| 81 | 87 | protected function getPath(KernelInterface $kernel): string |
| 82 | 88 | { |
| 83 | 89 | $path = $this->argument('path'); |
| 84 | - if ($path !== 'auto') { |
|
| 90 | + if ($path !== 'auto') |
|
| 91 | + { |
|
| 85 | 92 | return $path; |
| 86 | 93 | } |
| 87 | 94 | |
@@ -99,7 +106,8 @@ discard block |
||
| 99 | 106 | protected function getNamespace(KernelInterface $kernel): string |
| 100 | 107 | { |
| 101 | 108 | $namespace = $this->argument('namespace'); |
| 102 | - if ($namespace !== 'auto') { |
|
| 109 | + if ($namespace !== 'auto') |
|
| 110 | + { |
|
| 103 | 111 | return $namespace; |
| 104 | 112 | } |
| 105 | 113 | |