@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | public function testMountFileNotFound() |
24 | 24 | { |
25 | 25 | $out = $this->runCommand('encrypt:key', [ |
26 | - '-m' => __DIR__ . '/.env' |
|
26 | + '-m' => __DIR__.'/.env' |
|
27 | 27 | ]); |
28 | 28 | |
29 | 29 | $this->assertContains('Unable to find', $out); |
@@ -31,18 +31,18 @@ discard block |
||
31 | 31 | |
32 | 32 | public function testReplace() |
33 | 33 | { |
34 | - file_put_contents(__DIR__ . '/.env', '{encrypt-key}'); |
|
34 | + file_put_contents(__DIR__.'/.env', '{encrypt-key}'); |
|
35 | 35 | |
36 | 36 | $out = $this->runCommand('encrypt:key', [ |
37 | - '-m' => __DIR__ . '/.env' |
|
37 | + '-m' => __DIR__.'/.env' |
|
38 | 38 | ]); |
39 | 39 | |
40 | 40 | $this->assertContains('key has been updated', $out); |
41 | 41 | |
42 | - $body = file_get_contents(__DIR__ . '/.env'); |
|
42 | + $body = file_get_contents(__DIR__.'/.env'); |
|
43 | 43 | $this->assertContains($body, $out); |
44 | 44 | |
45 | - unlink(__DIR__ . '/.env'); |
|
45 | + unlink(__DIR__.'/.env'); |
|
46 | 46 | } |
47 | 47 | |
48 | 48 | public function testReplaceCurrent() |
@@ -53,18 +53,18 @@ discard block |
||
53 | 53 | 'ENCRYPTER_KEY' => $key |
54 | 54 | ]); |
55 | 55 | |
56 | - file_put_contents(__DIR__ . '/.env', $key); |
|
56 | + file_put_contents(__DIR__.'/.env', $key); |
|
57 | 57 | |
58 | 58 | $out = $app->console()->run('encrypt:key', [ |
59 | - '-m' => __DIR__ . '/.env' |
|
59 | + '-m' => __DIR__.'/.env' |
|
60 | 60 | ]); |
61 | 61 | $out = $out->getOutput()->fetch(); |
62 | 62 | |
63 | 63 | $this->assertContains('key has been updated', $out); |
64 | 64 | |
65 | - $body = file_get_contents(__DIR__ . '/.env'); |
|
65 | + $body = file_get_contents(__DIR__.'/.env'); |
|
66 | 66 | $this->assertContains($body, $out); |
67 | 67 | |
68 | - unlink(__DIR__ . '/.env'); |
|
68 | + unlink(__DIR__.'/.env'); |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | \ No newline at end of file |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | parent::setUp(); |
35 | 35 | |
36 | 36 | $fs = new Files(); |
37 | - $this->proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto'); |
|
37 | + $this->proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto'); |
|
38 | 38 | |
39 | 39 | // protoc can't figure relative paths |
40 | 40 | $this->proto = str_replace('Framework/../', '', $this->proto); |
@@ -46,12 +46,12 @@ discard block |
||
46 | 46 | |
47 | 47 | $fs = new Files(); |
48 | 48 | |
49 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
50 | - $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
|
49 | + if ($fs->isDirectory($this->app->dir('app').'src/Service')){ |
|
50 | + $fs->deleteDirectory($this->app->dir('app').'src/Service'); |
|
51 | 51 | } |
52 | 52 | |
53 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
54 | - $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
|
53 | + if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){ |
|
54 | + $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata'); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | 'proto' => $this->proto |
80 | 80 | ]); |
81 | 81 | |
82 | - $this->assertFileExists($this->app->dir('app') . 'src/Service/EchoInterface.php'); |
|
83 | - $this->assertFileExists($this->app->dir('app') . 'src/Service/Message.php'); |
|
84 | - $this->assertFileExists($this->app->dir('app') . 'src/GPBMetadata/Service.php'); |
|
82 | + $this->assertFileExists($this->app->dir('app').'src/Service/EchoInterface.php'); |
|
83 | + $this->assertFileExists($this->app->dir('app').'src/Service/Message.php'); |
|
84 | + $this->assertFileExists($this->app->dir('app').'src/GPBMetadata/Service.php'); |
|
85 | 85 | } |
86 | 86 | } |
87 | 87 | \ No newline at end of file |
@@ -46,11 +46,13 @@ |
||
46 | 46 | |
47 | 47 | $fs = new Files(); |
48 | 48 | |
49 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
49 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
50 | + { |
|
50 | 51 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
51 | 52 | } |
52 | 53 | |
53 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
54 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
55 | + { |
|
54 | 56 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
55 | 57 | } |
56 | 58 | } |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | parent::setUp(); |
22 | 22 | |
23 | 23 | $fs = new Files(); |
24 | - $this->proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto'); |
|
24 | + $this->proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto'); |
|
25 | 25 | |
26 | 26 | // protoc can't figure relative paths |
27 | 27 | $this->proto = str_replace('Framework/../', '', $this->proto); |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | |
34 | 34 | $fs = new Files(); |
35 | 35 | |
36 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
37 | - $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
|
36 | + if ($fs->isDirectory($this->app->dir('app').'src/Service')){ |
|
37 | + $fs->deleteDirectory($this->app->dir('app').'src/Service'); |
|
38 | 38 | } |
39 | 39 | |
40 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
41 | - $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
|
40 | + if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){ |
|
41 | + $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata'); |
|
42 | 42 | } |
43 | 43 | } |
44 | 44 | |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | 'proto' => $this->proto |
56 | 56 | ]); |
57 | 57 | |
58 | - file_put_contents($this->app->dir('app') . 'src/Service/EchoService.php', GenerateTest::SERVICE); |
|
58 | + file_put_contents($this->app->dir('app').'src/Service/EchoService.php', GenerateTest::SERVICE); |
|
59 | 59 | |
60 | 60 | $out = $this->runCommandDebug('grpc:services'); |
61 | 61 |
@@ -33,11 +33,13 @@ |
||
33 | 33 | |
34 | 34 | $fs = new Files(); |
35 | 35 | |
36 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
36 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
37 | + { |
|
37 | 38 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
38 | 39 | } |
39 | 40 | |
40 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
41 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
42 | + { |
|
41 | 43 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
42 | 44 | } |
43 | 45 | } |
@@ -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 |