@@ -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 |
@@ -40,7 +40,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -40,7 +40,8 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
@@ -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 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | EnvironmentInterface $env, |
48 | 48 | FinalizerInterface $finalizer, |
49 | 49 | ContainerInterface $container |
50 | - ) { |
|
50 | + ){ |
|
51 | 51 | $this->env = $env; |
52 | 52 | $this->finalizer = $finalizer; |
53 | 53 | $this->container = $container; |
@@ -76,11 +76,11 @@ discard block |
||
76 | 76 | /** @var Console $console */ |
77 | 77 | $console = $this->container->get(Console::class); |
78 | 78 | |
79 | - try { |
|
79 | + try{ |
|
80 | 80 | $console->start($input ?? new ArgvInput(), $output); |
81 | - } catch (\Throwable $e) { |
|
81 | + }catch (\Throwable $e){ |
|
82 | 82 | $this->handleException($e, $output); |
83 | - } finally { |
|
83 | + }finally{ |
|
84 | 84 | $listener->disable(); |
85 | 85 | $this->finalizer->finalize(false); |
86 | 86 | } |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function handleException(\Throwable $e, OutputInterface $output): void |
94 | 94 | { |
95 | - try { |
|
95 | + try{ |
|
96 | 96 | $this->container->get(SnapshotterInterface::class)->register($e); |
97 | - } catch (\Throwable | ContainerExceptionInterface $se) { |
|
97 | + }catch (\Throwable | ContainerExceptionInterface $se){ |
|
98 | 98 | // no need to notify when unable to register an exception |
99 | 99 | } |
100 | 100 | |
@@ -109,11 +109,11 @@ discard block |
||
109 | 109 | */ |
110 | 110 | private function mapVerbosity(OutputInterface $output): int |
111 | 111 | { |
112 | - if ($output->isDebug()) { |
|
112 | + if ($output->isDebug()){ |
|
113 | 113 | return ConsoleHandler::VERBOSITY_DEBUG; |
114 | 114 | } |
115 | 115 | |
116 | - if ($output->isVeryVerbose()) { |
|
116 | + if ($output->isVeryVerbose()){ |
|
117 | 117 | return ConsoleHandler::VERBOSITY_VERBOSE; |
118 | 118 | } |
119 | 119 |
@@ -76,11 +76,16 @@ discard block |
||
76 | 76 | /** @var Console $console */ |
77 | 77 | $console = $this->container->get(Console::class); |
78 | 78 | |
79 | - try { |
|
79 | + try |
|
80 | + { |
|
80 | 81 | $console->start($input ?? new ArgvInput(), $output); |
81 | - } catch (\Throwable $e) { |
|
82 | + } |
|
83 | + catch (\Throwable $e) |
|
84 | + { |
|
82 | 85 | $this->handleException($e, $output); |
83 | - } finally { |
|
86 | + } |
|
87 | + finally |
|
88 | + { |
|
84 | 89 | $listener->disable(); |
85 | 90 | $this->finalizer->finalize(false); |
86 | 91 | } |
@@ -92,9 +97,12 @@ discard block |
||
92 | 97 | */ |
93 | 98 | protected function handleException(\Throwable $e, OutputInterface $output): void |
94 | 99 | { |
95 | - try { |
|
100 | + try |
|
101 | + { |
|
96 | 102 | $this->container->get(SnapshotterInterface::class)->register($e); |
97 | - } catch (\Throwable | ContainerExceptionInterface $se) { |
|
103 | + } |
|
104 | + catch (\Throwable | ContainerExceptionInterface $se) |
|
105 | + { |
|
98 | 106 | // no need to notify when unable to register an exception |
99 | 107 | } |
100 | 108 | |
@@ -109,11 +117,13 @@ discard block |
||
109 | 117 | */ |
110 | 118 | private function mapVerbosity(OutputInterface $output): int |
111 | 119 | { |
112 | - if ($output->isDebug()) { |
|
120 | + if ($output->isDebug()) |
|
121 | + { |
|
113 | 122 | return ConsoleHandler::VERBOSITY_DEBUG; |
114 | 123 | } |
115 | 124 | |
116 | - if ($output->isVeryVerbose()) { |
|
125 | + if ($output->isVeryVerbose()) |
|
126 | + { |
|
117 | 127 | return ConsoleHandler::VERBOSITY_VERBOSE; |
118 | 128 | } |
119 | 129 |
@@ -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 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | public function testReset(): void |
18 | 18 | { |
19 | - $this->assertFileNotExists(__DIR__ . '/messages.ru.php'); |
|
19 | + $this->assertFileNotExists(__DIR__.'/messages.ru.php'); |
|
20 | 20 | |
21 | 21 | $this->runCommandDebug('i18n:index'); |
22 | 22 | $this->runCommandDebug('configure'); |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | '--fallback' => 'en', |
27 | 27 | ]); |
28 | 28 | |
29 | - $this->assertFileExists(__DIR__ . '/messages.ru.php'); |
|
29 | + $this->assertFileExists(__DIR__.'/messages.ru.php'); |
|
30 | 30 | |
31 | - $exp = (require __DIR__ . '/messages.ru.php'); |
|
31 | + $exp = (require __DIR__.'/messages.ru.php'); |
|
32 | 32 | |
33 | 33 | $this->assertArrayHasKey('World', $exp); |
34 | 34 | $this->assertSame('Мир', $exp['World']); |
@@ -36,6 +36,6 @@ discard block |
||
36 | 36 | $this->assertArrayHasKey('%s unit|%s units', $exp); |
37 | 37 | $this->assertArrayHasKey('This value is required.', $exp); |
38 | 38 | |
39 | - unlink(__DIR__ . '/messages.ru.php'); |
|
39 | + unlink(__DIR__.'/messages.ru.php'); |
|
40 | 40 | } |
41 | 41 | } |
@@ -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 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public function testMountFileNotFound(): void |
25 | 25 | { |
26 | 26 | $out = $this->runCommand('encrypt:key', [ |
27 | - '-m' => __DIR__ . '/.env' |
|
27 | + '-m' => __DIR__.'/.env' |
|
28 | 28 | ]); |
29 | 29 | |
30 | 30 | $this->assertContains('Unable to find', $out); |
@@ -32,18 +32,18 @@ discard block |
||
32 | 32 | |
33 | 33 | public function testReplace(): void |
34 | 34 | { |
35 | - file_put_contents(__DIR__ . '/.env', '{encrypt-key}'); |
|
35 | + file_put_contents(__DIR__.'/.env', '{encrypt-key}'); |
|
36 | 36 | |
37 | 37 | $out = $this->runCommand('encrypt:key', [ |
38 | - '-m' => __DIR__ . '/.env' |
|
38 | + '-m' => __DIR__.'/.env' |
|
39 | 39 | ]); |
40 | 40 | |
41 | 41 | $this->assertContains('key has been updated', $out); |
42 | 42 | |
43 | - $body = file_get_contents(__DIR__ . '/.env'); |
|
43 | + $body = file_get_contents(__DIR__.'/.env'); |
|
44 | 44 | $this->assertContains($body, $out); |
45 | 45 | |
46 | - unlink(__DIR__ . '/.env'); |
|
46 | + unlink(__DIR__.'/.env'); |
|
47 | 47 | } |
48 | 48 | |
49 | 49 | public function testReplaceCurrent(): void |
@@ -54,18 +54,18 @@ discard block |
||
54 | 54 | 'ENCRYPTER_KEY' => $key |
55 | 55 | ]); |
56 | 56 | |
57 | - file_put_contents(__DIR__ . '/.env', $key); |
|
57 | + file_put_contents(__DIR__.'/.env', $key); |
|
58 | 58 | |
59 | 59 | $out = $app->console()->run('encrypt:key', [ |
60 | - '-m' => __DIR__ . '/.env' |
|
60 | + '-m' => __DIR__.'/.env' |
|
61 | 61 | ]); |
62 | 62 | $out = $out->getOutput()->fetch(); |
63 | 63 | |
64 | 64 | $this->assertContains('key has been updated', $out); |
65 | 65 | |
66 | - $body = file_get_contents(__DIR__ . '/.env'); |
|
66 | + $body = file_get_contents(__DIR__.'/.env'); |
|
67 | 67 | $this->assertContains($body, $out); |
68 | 68 | |
69 | - unlink(__DIR__ . '/.env'); |
|
69 | + unlink(__DIR__.'/.env'); |
|
70 | 70 | } |
71 | 71 | } |