@@ -58,14 +58,16 @@ discard block |
||
58 | 58 | |
59 | 59 | $output = trim(join("\n", $output), "\n ,"); |
60 | 60 | |
61 | - if ($output !== '') { |
|
61 | + if ($output !== '') |
|
62 | + { |
|
62 | 63 | $this->files->deleteDirectory($tmpDir); |
63 | 64 | throw new CompileException($output); |
64 | 65 | } |
65 | 66 | |
66 | 67 | // copying files (using relative path and namespace) |
67 | 68 | $result = []; |
68 | - foreach ($this->files->getFiles($tmpDir) as $file) { |
|
69 | + foreach ($this->files->getFiles($tmpDir) as $file) |
|
70 | + { |
|
69 | 71 | $result[] = $this->copy($tmpDir, $file); |
70 | 72 | } |
71 | 73 | |
@@ -82,7 +84,8 @@ discard block |
||
82 | 84 | private function copy(string $tmpDir, string $file): string |
83 | 85 | { |
84 | 86 | $source = ltrim($this->files->relativePath($file, $tmpDir), '\\/'); |
85 | - if (strpos($source, $this->baseNamespace) === 0) { |
|
87 | + if (strpos($source, $this->baseNamespace) === 0) |
|
88 | + { |
|
86 | 89 | $source = ltrim(substr($source, strlen($this->baseNamespace)), '\\/'); |
87 | 90 | } |
88 | 91 |
@@ -19,7 +19,8 @@ discard block |
||
19 | 19 | public function setUp() |
20 | 20 | { |
21 | 21 | exec('protoc 2>&1', $out); |
22 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
22 | + if (strpos(join("\n", $out), '--php_out') === false) |
|
23 | + { |
|
23 | 24 | $this->markTestSkipped('Protoc binary is missing'); |
24 | 25 | return; |
25 | 26 | } |
@@ -39,11 +40,13 @@ discard block |
||
39 | 40 | |
40 | 41 | $fs = new Files(); |
41 | 42 | |
42 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
43 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
44 | + { |
|
43 | 45 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
44 | 46 | } |
45 | 47 | |
46 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
48 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
49 | + { |
|
47 | 50 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
48 | 51 | } |
49 | 52 | } |
@@ -21,7 +21,8 @@ discard block |
||
21 | 21 | public function setUp() |
22 | 22 | { |
23 | 23 | exec('protoc 2>&1', $out); |
24 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
24 | + if (strpos(join("\n", $out), '--php_out') === false) |
|
25 | + { |
|
25 | 26 | $this->markTestSkipped('Protoc binary is missing'); |
26 | 27 | } |
27 | 28 | |
@@ -46,11 +47,13 @@ discard block |
||
46 | 47 | |
47 | 48 | $fs = new Files(); |
48 | 49 | |
49 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
50 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
51 | + { |
|
50 | 52 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
51 | 53 | } |
52 | 54 | |
53 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
55 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
56 | + { |
|
54 | 57 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
55 | 58 | } |
56 | 59 | } |
@@ -77,7 +80,8 @@ discard block |
||
77 | 80 | $msg->setMsg("hello"); |
78 | 81 | |
79 | 82 | $w->shouldReceive('receive')->once()->with( |
80 | - \Mockery::on(function (&$context) { |
|
83 | + \Mockery::on(function (&$context) |
|
84 | + { |
|
81 | 85 | $context = '{ |
82 | 86 | "service": "service.Echo", |
83 | 87 | "method": "Ping" |
@@ -88,7 +92,8 @@ discard block |
||
88 | 92 | )->andReturn($msg->serializeToString()); |
89 | 93 | |
90 | 94 | $w->shouldReceive('send')->once()->with( |
91 | - \Mockery::on(function ($out) { |
|
95 | + \Mockery::on(function ($out) |
|
96 | + { |
|
92 | 97 | |
93 | 98 | $msg = new Message(); |
94 | 99 | $msg->mergeFromString($out); |
@@ -100,7 +105,8 @@ discard block |
||
100 | 105 | |
101 | 106 | // one command only |
102 | 107 | $w->shouldReceive('receive')->once()->with( |
103 | - \Mockery::on(function (&$context) { |
|
108 | + \Mockery::on(function (&$context) |
|
109 | + { |
|
104 | 110 | $context = null; |
105 | 111 | return true; |
106 | 112 | }) |
@@ -120,7 +126,8 @@ discard block |
||
120 | 126 | $msg->setMsg("hello"); |
121 | 127 | |
122 | 128 | $w->shouldReceive('receive')->once()->with( |
123 | - \Mockery::on(function (&$context) { |
|
129 | + \Mockery::on(function (&$context) |
|
130 | + { |
|
124 | 131 | $context = '{ |
125 | 132 | "service": "service.Echo", |
126 | 133 | "method": "Invalid" |
@@ -131,7 +138,8 @@ discard block |
||
131 | 138 | )->andReturn($msg->serializeToString()); |
132 | 139 | |
133 | 140 | $w->shouldReceive('error')->once()->with( |
134 | - \Mockery::on(function ($out) { |
|
141 | + \Mockery::on(function ($out) |
|
142 | + { |
|
135 | 143 | $this->assertContains('Method `Invalid` not found', $out); |
136 | 144 | return true; |
137 | 145 | }) |
@@ -139,7 +147,8 @@ discard block |
||
139 | 147 | |
140 | 148 | // one command only |
141 | 149 | $w->shouldReceive('receive')->once()->with( |
142 | - \Mockery::on(function (&$context) { |
|
150 | + \Mockery::on(function (&$context) |
|
151 | + { |
|
143 | 152 | $context = null; |
144 | 153 | return true; |
145 | 154 | }) |
@@ -32,7 +32,8 @@ discard block |
||
32 | 32 | public function setUp() |
33 | 33 | { |
34 | 34 | exec('protoc 2>&1', $out); |
35 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
35 | + if (strpos(join("\n", $out), '--php_out') === false) |
|
36 | + { |
|
36 | 37 | $this->markTestSkipped('Protoc binary is missing'); |
37 | 38 | } |
38 | 39 | |
@@ -51,11 +52,13 @@ discard block |
||
51 | 52 | |
52 | 53 | $fs = new Files(); |
53 | 54 | |
54 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
55 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
56 | + { |
|
55 | 57 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
56 | 58 | } |
57 | 59 | |
58 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
60 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
61 | + { |
|
59 | 62 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
60 | 63 | } |
61 | 64 | } |