@@ -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 | } |
@@ -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 |
@@ -31,7 +31,7 @@ |
||
31 | 31 | |
32 | 32 | public function compile(string $path, ContextInterface $context): void |
33 | 33 | { |
34 | - if ($path == 'custom:error') { |
|
34 | + if ($path == 'custom:error'){ |
|
35 | 35 | throw new EngineException('Unable to compile custom:error'); |
36 | 36 | } |
37 | 37 | } |
@@ -31,7 +31,8 @@ |
||
31 | 31 | |
32 | 32 | public function compile(string $path, ContextInterface $context): void |
33 | 33 | { |
34 | - if ($path == 'custom:error') { |
|
34 | + if ($path == 'custom:error') |
|
35 | + { |
|
35 | 36 | throw new EngineException('Unable to compile custom:error'); |
36 | 37 | } |
37 | 38 | } |
@@ -12,4 +12,4 @@ |
||
12 | 12 | ini_set('display_errors', '1'); |
13 | 13 | |
14 | 14 | //Composer |
15 | -require dirname(__DIR__) . '/vendor/autoload.php'; |
|
15 | +require dirname(__DIR__).'/vendor/autoload.php'; |
@@ -41,7 +41,7 @@ |
||
41 | 41 | */ |
42 | 42 | public function getValue(string $source, string $name = null) |
43 | 43 | { |
44 | - if (!method_exists($this->input, $source)) { |
|
44 | + if (!method_exists($this->input, $source)){ |
|
45 | 45 | throw new InputException("Undefined input source '{$source}'"); |
46 | 46 | } |
47 | 47 |
@@ -41,7 +41,8 @@ |
||
41 | 41 | */ |
42 | 42 | public function getValue(string $source, string $name = null) |
43 | 43 | { |
44 | - if (!method_exists($this->input, $source)) { |
|
44 | + if (!method_exists($this->input, $source)) |
|
45 | + { |
|
45 | 46 | throw new InputException("Undefined input source '{$source}'"); |
46 | 47 | } |
47 | 48 |
@@ -57,7 +57,7 @@ |
||
57 | 57 | private function route(ServerRequestInterface $request): RouteInterface |
58 | 58 | { |
59 | 59 | $route = $request->getAttribute(Router::ROUTE_ATTRIBUTE, null); |
60 | - if ($route === null) { |
|
60 | + if ($route === null){ |
|
61 | 61 | throw new ScopeException('Unable to resolve Route, invalid request scope'); |
62 | 62 | } |
63 | 63 |
@@ -57,7 +57,8 @@ |
||
57 | 57 | private function route(ServerRequestInterface $request): RouteInterface |
58 | 58 | { |
59 | 59 | $route = $request->getAttribute(Router::ROUTE_ATTRIBUTE, null); |
60 | - if ($route === null) { |
|
60 | + if ($route === null) |
|
61 | + { |
|
61 | 62 | throw new ScopeException('Unable to resolve Route, invalid request scope'); |
62 | 63 | } |
63 | 64 |
@@ -72,7 +72,7 @@ |
||
72 | 72 | private function cookieQueue(ServerRequestInterface $request): CookieQueue |
73 | 73 | { |
74 | 74 | $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE, null); |
75 | - if ($cookieQueue === null) { |
|
75 | + if ($cookieQueue === null){ |
|
76 | 76 | throw new ScopeException('Unable to resolve CookieQueue, invalid request scope'); |
77 | 77 | } |
78 | 78 |
@@ -72,7 +72,8 @@ |
||
72 | 72 | private function cookieQueue(ServerRequestInterface $request): CookieQueue |
73 | 73 | { |
74 | 74 | $cookieQueue = $request->getAttribute(CookieQueue::ATTRIBUTE, null); |
75 | - if ($cookieQueue === null) { |
|
75 | + if ($cookieQueue === null) |
|
76 | + { |
|
76 | 77 | throw new ScopeException('Unable to resolve CookieQueue, invalid request scope'); |
77 | 78 | } |
78 | 79 |
@@ -22,14 +22,14 @@ discard block |
||
22 | 22 | public function setUp(): void |
23 | 23 | { |
24 | 24 | exec('protoc 2>&1', $out); |
25 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
25 | + if (strpos(join("\n", $out), '--php_out') === false){ |
|
26 | 26 | $this->markTestSkipped('Protoc binary is missing'); |
27 | 27 | } |
28 | 28 | |
29 | 29 | parent::setUp(); |
30 | 30 | |
31 | 31 | $fs = new Files(); |
32 | - $proto = $fs->normalizePath($this->app->dir('app') . 'proto/service.proto'); |
|
32 | + $proto = $fs->normalizePath($this->app->dir('app').'proto/service.proto'); |
|
33 | 33 | |
34 | 34 | // protoc can't figure relative paths |
35 | 35 | $proto = str_replace('Framework/../', '', $proto); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | 'proto' => $proto |
39 | 39 | ]); |
40 | 40 | |
41 | - file_put_contents($this->app->dir('app') . 'src/Service/EchoService.php', GenerateTest::SERVICE); |
|
41 | + file_put_contents($this->app->dir('app').'src/Service/EchoService.php', GenerateTest::SERVICE); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | public function tearDown(): void |
@@ -47,12 +47,12 @@ discard block |
||
47 | 47 | |
48 | 48 | $fs = new Files(); |
49 | 49 | |
50 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
51 | - $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
|
50 | + if ($fs->isDirectory($this->app->dir('app').'src/Service')){ |
|
51 | + $fs->deleteDirectory($this->app->dir('app').'src/Service'); |
|
52 | 52 | } |
53 | 53 | |
54 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
55 | - $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
|
54 | + if ($fs->isDirectory($this->app->dir('app').'src/GPBMetadata')){ |
|
55 | + $fs->deleteDirectory($this->app->dir('app').'src/GPBMetadata'); |
|
56 | 56 | } |
57 | 57 | } |
58 | 58 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | $msg->setMsg('hello'); |
79 | 79 | |
80 | 80 | $w->shouldReceive('receive')->once()->with( |
81 | - \Mockery::on(function (&$context) { |
|
81 | + \Mockery::on(function (&$context){ |
|
82 | 82 | $context = '{ |
83 | 83 | "service": "service.Echo", |
84 | 84 | "method": "Ping" |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | )->andReturn($msg->serializeToString()); |
90 | 90 | |
91 | 91 | $w->shouldReceive('send')->once()->with( |
92 | - \Mockery::on(function ($out) { |
|
92 | + \Mockery::on(function ($out){ |
|
93 | 93 | $msg = new Message(); |
94 | 94 | $msg->mergeFromString($out); |
95 | 95 | $this->assertSame('hello', $msg->getMsg()); |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | |
101 | 101 | // one command only |
102 | 102 | $w->shouldReceive('receive')->once()->with( |
103 | - \Mockery::on(function (&$context) { |
|
103 | + \Mockery::on(function (&$context){ |
|
104 | 104 | $context = null; |
105 | 105 | return true; |
106 | 106 | }) |
@@ -120,7 +120,7 @@ discard block |
||
120 | 120 | $msg->setMsg('hello'); |
121 | 121 | |
122 | 122 | $w->shouldReceive('receive')->once()->with( |
123 | - \Mockery::on(function (&$context) { |
|
123 | + \Mockery::on(function (&$context){ |
|
124 | 124 | $context = '{ |
125 | 125 | "service": "service.Echo", |
126 | 126 | "method": "Invalid" |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | )->andReturn($msg->serializeToString()); |
132 | 132 | |
133 | 133 | $w->shouldReceive('error')->once()->with( |
134 | - \Mockery::on(function ($out) { |
|
134 | + \Mockery::on(function ($out){ |
|
135 | 135 | $this->assertContains('Method `Invalid` not found', $out); |
136 | 136 | return true; |
137 | 137 | }) |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | // one command only |
141 | 141 | $w->shouldReceive('receive')->once()->with( |
142 | - \Mockery::on(function (&$context) { |
|
142 | + \Mockery::on(function (&$context){ |
|
143 | 143 | $context = null; |
144 | 144 | return true; |
145 | 145 | }) |
@@ -22,7 +22,8 @@ discard block |
||
22 | 22 | public function setUp(): void |
23 | 23 | { |
24 | 24 | exec('protoc 2>&1', $out); |
25 | - if (strpos(join("\n", $out), '--php_out') === false) { |
|
25 | + if (strpos(join("\n", $out), '--php_out') === false) |
|
26 | + { |
|
26 | 27 | $this->markTestSkipped('Protoc binary is missing'); |
27 | 28 | } |
28 | 29 | |
@@ -47,11 +48,13 @@ discard block |
||
47 | 48 | |
48 | 49 | $fs = new Files(); |
49 | 50 | |
50 | - if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) { |
|
51 | + if ($fs->isDirectory($this->app->dir('app') . 'src/Service')) |
|
52 | + { |
|
51 | 53 | $fs->deleteDirectory($this->app->dir('app') . 'src/Service'); |
52 | 54 | } |
53 | 55 | |
54 | - if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) { |
|
56 | + if ($fs->isDirectory($this->app->dir('app') . 'src/GPBMetadata')) |
|
57 | + { |
|
55 | 58 | $fs->deleteDirectory($this->app->dir('app') . 'src/GPBMetadata'); |
56 | 59 | } |
57 | 60 | } |
@@ -78,7 +81,8 @@ discard block |
||
78 | 81 | $msg->setMsg('hello'); |
79 | 82 | |
80 | 83 | $w->shouldReceive('receive')->once()->with( |
81 | - \Mockery::on(function (&$context) { |
|
84 | + \Mockery::on(function (&$context) |
|
85 | + { |
|
82 | 86 | $context = '{ |
83 | 87 | "service": "service.Echo", |
84 | 88 | "method": "Ping" |
@@ -89,7 +93,8 @@ discard block |
||
89 | 93 | )->andReturn($msg->serializeToString()); |
90 | 94 | |
91 | 95 | $w->shouldReceive('send')->once()->with( |
92 | - \Mockery::on(function ($out) { |
|
96 | + \Mockery::on(function ($out) |
|
97 | + { |
|
93 | 98 | $msg = new Message(); |
94 | 99 | $msg->mergeFromString($out); |
95 | 100 | $this->assertSame('hello', $msg->getMsg()); |
@@ -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 | }) |