@@ -39,7 +39,8 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | } |
@@ -56,12 +56,12 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -56,12 +56,15 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -34,13 +34,13 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -34,13 +34,17 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -27,7 +27,7 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -27,7 +27,8 @@ discard block |
||
| 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 |
||
| 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 | |
@@ -55,21 +55,21 @@ |
||
| 55 | 55 | $this->sprintf("<info>New encryption key:</info> <fg=cyan>%s</fg=cyan>\n", $key); |
| 56 | 56 | |
| 57 | 57 | $file = $this->option('mount'); |
| 58 | - if ($file === null) { |
|
| 58 | + if ($file === null){ |
|
| 59 | 59 | return; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (!$files->exists($file)) { |
|
| 62 | + if (!$files->exists($file)){ |
|
| 63 | 63 | $this->sprintf('<error>Unable to find `%s`</error>', $file); |
| 64 | 64 | return; |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | $content = $files->read($file); |
| 68 | 68 | |
| 69 | - try { |
|
| 69 | + try{ |
|
| 70 | 70 | $content = str_replace($this->option('placeholder'), $key, $content); |
| 71 | 71 | $content = str_replace($enc->getKey(), $key, $content); |
| 72 | - } catch (\Throwable $e) { |
|
| 72 | + }catch (\Throwable $e){ |
|
| 73 | 73 | // current keys is not set |
| 74 | 74 | } |
| 75 | 75 | |
@@ -55,21 +55,26 @@ |
||
| 55 | 55 | $this->sprintf("<info>New encryption key:</info> <fg=cyan>%s</fg=cyan>\n", $key); |
| 56 | 56 | |
| 57 | 57 | $file = $this->option('mount'); |
| 58 | - if ($file === null) { |
|
| 58 | + if ($file === null) |
|
| 59 | + { |
|
| 59 | 60 | return; |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | - if (!$files->exists($file)) { |
|
| 63 | + if (!$files->exists($file)) |
|
| 64 | + { |
|
| 63 | 65 | $this->sprintf('<error>Unable to find `%s`</error>', $file); |
| 64 | 66 | return; |
| 65 | 67 | } |
| 66 | 68 | |
| 67 | 69 | $content = $files->read($file); |
| 68 | 70 | |
| 69 | - try { |
|
| 71 | + try |
|
| 72 | + { |
|
| 70 | 73 | $content = str_replace($this->option('placeholder'), $key, $content); |
| 71 | 74 | $content = str_replace($enc->getKey(), $key, $content); |
| 72 | - } catch (\Throwable $e) { |
|
| 75 | + } |
|
| 76 | + catch (\Throwable $e) |
|
| 77 | + { |
|
| 73 | 78 | // current keys is not set |
| 74 | 79 | } |
| 75 | 80 | |
@@ -20,9 +20,9 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $app = $this->makeApp(); |
| 22 | 22 | |
| 23 | - try { |
|
| 23 | + try{ |
|
| 24 | 24 | throw new \Error('test error'); |
| 25 | - } catch (\Error $e) { |
|
| 25 | + }catch (\Error $e){ |
|
| 26 | 26 | /** @var SnapshotInterface $s */ |
| 27 | 27 | $s = $app->get(SnapshotterInterface::class)->register($e); |
| 28 | 28 | } |
@@ -20,9 +20,12 @@ |
||
| 20 | 20 | { |
| 21 | 21 | $app = $this->makeApp(); |
| 22 | 22 | |
| 23 | - try { |
|
| 23 | + try |
|
| 24 | + { |
|
| 24 | 25 | throw new \Error('test error'); |
| 25 | - } catch (\Error $e) { |
|
| 26 | + } |
|
| 27 | + catch (\Error $e) |
|
| 28 | + { |
|
| 26 | 29 | /** @var SnapshotInterface $s */ |
| 27 | 30 | $s = $app->get(SnapshotterInterface::class)->register($e); |
| 28 | 31 | } |
@@ -33,14 +33,14 @@ discard block |
||
| 33 | 33 | public function setUp(): void |
| 34 | 34 | { |
| 35 | 35 | exec('protoc 2>&1', $out); |
| 36 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
| 36 | + if (strpos(join("\n", $out), '--php_out') === false){ |
|
| 37 | 37 | $this->markTestSkipped('Protoc binary is missing'); |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | parent::setUp(); |
| 41 | 41 | |
| 42 | 42 | $fs = new Files(); |
| 43 | - $this->proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto'); |
|
| 43 | + $this->proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto'); |
|
| 44 | 44 | |
| 45 | 45 | // protoc can't figure relative paths |
| 46 | 46 | $this->proto = str_replace('Framework/../', '', $this->proto); |
@@ -52,12 +52,12 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $fs = new Files(); |
| 54 | 54 | |
| 55 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
| 56 | - $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
|
| 55 | + if ($fs->isDirectory($this->app->dir('app').'src/Service')){ |
|
| 56 | + $fs->deleteDirectory($this->app->dir('app').'src/Service'); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
| 60 | - $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
|
| 59 | + if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){ |
|
| 60 | + $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata'); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -85,8 +85,8 @@ discard block |
||
| 85 | 85 | 'proto' => $this->proto |
| 86 | 86 | ]); |
| 87 | 87 | |
| 88 | - $this->assertFileExists($this->app->dir('app') . 'src/Service/EchoInterface.php'); |
|
| 89 | - $this->assertFileExists($this->app->dir('app') . 'src/Service/Sub/Message.php'); |
|
| 90 | - $this->assertFileExists($this->app->dir('app') . 'src/GPBMetadata/Service.php'); |
|
| 88 | + $this->assertFileExists($this->app->dir('app').'src/Service/EchoInterface.php'); |
|
| 89 | + $this->assertFileExists($this->app->dir('app').'src/Service/Sub/Message.php'); |
|
| 90 | + $this->assertFileExists($this->app->dir('app').'src/GPBMetadata/Service.php'); |
|
| 91 | 91 | } |
| 92 | 92 | } |
@@ -33,7 +33,8 @@ discard block |
||
| 33 | 33 | public function setUp(): void |
| 34 | 34 | { |
| 35 | 35 | exec('protoc 2>&1', $out); |
| 36 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
| 36 | + if (strpos(join("\n", $out), '--php_out') === false) |
|
| 37 | + { |
|
| 37 | 38 | $this->markTestSkipped('Protoc binary is missing'); |
| 38 | 39 | } |
| 39 | 40 | |
@@ -52,11 +53,13 @@ discard block |
||
| 52 | 53 | |
| 53 | 54 | $fs = new Files(); |
| 54 | 55 | |
| 55 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
| 56 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
| 57 | + { |
|
| 56 | 58 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
| 57 | 59 | } |
| 58 | 60 | |
| 59 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
| 61 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
| 62 | + { |
|
| 60 | 63 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
| 61 | 64 | } |
| 62 | 65 | } |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public function setUp(): void |
| 21 | 21 | { |
| 22 | 22 | exec('protoc 2>&1', $out); |
| 23 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
| 23 | + if (strpos(join("\n", $out), '--php_out') === false){ |
|
| 24 | 24 | $this->markTestSkipped('Protoc binary is missing'); |
| 25 | 25 | return; |
| 26 | 26 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | parent::setUp(); |
| 29 | 29 | |
| 30 | 30 | $fs = new Files(); |
| 31 | - $this->proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto'); |
|
| 31 | + $this->proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto'); |
|
| 32 | 32 | |
| 33 | 33 | // protoc can't figure relative paths |
| 34 | 34 | $this->proto = str_replace('Framework/../', '', $this->proto); |
@@ -40,12 +40,12 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | $fs = new Files(); |
| 42 | 42 | |
| 43 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
| 44 | - $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
|
| 43 | + if ($fs->isDirectory($this->app->dir('app').'src/Service')){ |
|
| 44 | + $fs->deleteDirectory($this->app->dir('app').'src/Service'); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
| 48 | - $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
|
| 47 | + if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){ |
|
| 48 | + $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata'); |
|
| 49 | 49 | } |
| 50 | 50 | } |
| 51 | 51 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | 'proto' => $this->proto |
| 63 | 63 | ]); |
| 64 | 64 | |
| 65 | - file_put_contents($this->app->dir('app') . 'src/Service/EchoService.php', GenerateTest::SERVICE); |
|
| 65 | + file_put_contents($this->app->dir('app').'src/Service/EchoService.php', GenerateTest::SERVICE); |
|
| 66 | 66 | |
| 67 | 67 | $out = $this->runCommandDebug('grpc:services'); |
| 68 | 68 | |
@@ -20,7 +20,8 @@ discard block |
||
| 20 | 20 | public function setUp(): void |
| 21 | 21 | { |
| 22 | 22 | exec('protoc 2>&1', $out); |
| 23 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
| 23 | + if (strpos(join("\n", $out), '--php_out') === false) |
|
| 24 | + { |
|
| 24 | 25 | $this->markTestSkipped('Protoc binary is missing'); |
| 25 | 26 | return; |
| 26 | 27 | } |
@@ -40,11 +41,13 @@ discard block |
||
| 40 | 41 | |
| 41 | 42 | $fs = new Files(); |
| 42 | 43 | |
| 43 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
| 44 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
| 45 | + { |
|
| 44 | 46 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
| 45 | 47 | } |
| 46 | 48 | |
| 47 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
| 49 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
| 50 | + { |
|
| 48 | 51 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
| 49 | 52 | } |
| 50 | 53 | } |
@@ -15,12 +15,12 @@ discard block |
||
| 15 | 15 | |
| 16 | 16 | class PublishTest extends ConsoleTest |
| 17 | 17 | { |
| 18 | - protected const TEST_FILE = __DIR__ . '/test.txt'; |
|
| 19 | - protected const TEST_FILE_2 = __DIR__ . '/PublishTest.php'; |
|
| 18 | + protected const TEST_FILE = __DIR__.'/test.txt'; |
|
| 19 | + protected const TEST_FILE_2 = __DIR__.'/PublishTest.php'; |
|
| 20 | 20 | |
| 21 | 21 | public function tearDown(): void |
| 22 | 22 | { |
| 23 | - if (file_exists(self::TEST_FILE)) { |
|
| 23 | + if (file_exists(self::TEST_FILE)){ |
|
| 24 | 24 | unlink(self::TEST_FILE); |
| 25 | 25 | } |
| 26 | 26 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $this->runCommandDebug('publish', [ |
| 177 | 177 | 'type' => 'replace', |
| 178 | 178 | 'target' => '@runtime', |
| 179 | - 'source' => __DIR__ . '/*', |
|
| 179 | + 'source' => __DIR__.'/*', |
|
| 180 | 180 | 'mode' => 'runtime' |
| 181 | 181 | ]); |
| 182 | 182 | |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | $this->runCommandDebug('publish', [ |
| 195 | 195 | 'type' => 'follow', |
| 196 | 196 | 'target' => '@runtime', |
| 197 | - 'source' => __DIR__ . '/*', |
|
| 197 | + 'source' => __DIR__.'/*', |
|
| 198 | 198 | 'mode' => 'runtime' |
| 199 | 199 | ]); |
| 200 | 200 | |
@@ -212,7 +212,7 @@ discard block |
||
| 212 | 212 | $this->runCommandDebug('publish', [ |
| 213 | 213 | 'type' => 'follow', |
| 214 | 214 | 'target' => '@runtime/test.txt', |
| 215 | - 'source' => self::TEST_FILE . 'invalid', |
|
| 215 | + 'source' => self::TEST_FILE.'invalid', |
|
| 216 | 216 | 'mode' => 'runtime' |
| 217 | 217 | ]); |
| 218 | 218 | } |
@@ -227,13 +227,13 @@ discard block |
||
| 227 | 227 | $this->runCommandDebug('publish', [ |
| 228 | 228 | 'type' => 'follow', |
| 229 | 229 | 'target' => '@runtime/test.txt', |
| 230 | - 'source' => self::TEST_FILE . 'invalid/*', |
|
| 230 | + 'source' => self::TEST_FILE.'invalid/*', |
|
| 231 | 231 | 'mode' => 'runtime' |
| 232 | 232 | ]); |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | protected function file(string $dir, string $name) |
| 236 | 236 | { |
| 237 | - return $this->app->get(DirectoriesInterface::class)->get($dir) . $name; |
|
| 237 | + return $this->app->get(DirectoriesInterface::class)->get($dir).$name; |
|
| 238 | 238 | } |
| 239 | 239 | } |
@@ -20,7 +20,8 @@ |
||
| 20 | 20 | |
| 21 | 21 | public function tearDown(): void |
| 22 | 22 | { |
| 23 | - if (file_exists(self::TEST_FILE)) { |
|
| 23 | + if (file_exists(self::TEST_FILE)) |
|
| 24 | + { |
|
| 24 | 25 | unlink(self::TEST_FILE); |
| 25 | 26 | } |
| 26 | 27 | |