@@ -26,20 +26,26 @@ discard block |
||
26 | 26 | public function perform(FilesInterface $files, DirectoriesInterface $directories) |
27 | 27 | { |
28 | 28 | $cacheDirectory = $directories->get('cache'); |
29 | - if (!$files->exists($cacheDirectory)) { |
|
29 | + if (!$files->exists($cacheDirectory)) |
|
30 | + { |
|
30 | 31 | $this->writeln("Cache directory is missing, no cache to be cleaned."); |
31 | 32 | |
32 | 33 | return; |
33 | 34 | } |
34 | 35 | |
35 | - if ($this->isVerbose()) { |
|
36 | + if ($this->isVerbose()) |
|
37 | + { |
|
36 | 38 | $this->writeln("<info>Cleaning application cache:</info>"); |
37 | 39 | } |
38 | 40 | |
39 | - foreach ($files->getFiles($cacheDirectory) as $filename) { |
|
40 | - try { |
|
41 | + foreach ($files->getFiles($cacheDirectory) as $filename) |
|
42 | + { |
|
43 | + try |
|
44 | + { |
|
41 | 45 | $files->delete($filename); |
42 | - } catch (\Throwable $e) { |
|
46 | + } |
|
47 | + catch (\Throwable $e) |
|
48 | + { |
|
43 | 49 | // @codeCoverageIgnoreStart |
44 | 50 | $this->sprintf( |
45 | 51 | "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n", |
@@ -51,7 +57,8 @@ discard block |
||
51 | 57 | // @codeCoverageIgnoreEnd |
52 | 58 | } |
53 | 59 | |
54 | - if ($this->isVerbose()) { |
|
60 | + if ($this->isVerbose()) |
|
61 | + { |
|
55 | 62 | $this->sprintf( |
56 | 63 | "<fg=green>[deleted]</fg=green> `%s`\n", |
57 | 64 | $files->relativePath($filename, $cacheDirectory) |
@@ -27,20 +27,26 @@ discard block |
||
27 | 27 | */ |
28 | 28 | public function perform(ViewsConfig $config, FilesInterface $files) |
29 | 29 | { |
30 | - if (!$files->exists($config->getCacheDirectory())) { |
|
30 | + if (!$files->exists($config->getCacheDirectory())) |
|
31 | + { |
|
31 | 32 | $this->writeln("Cache directory is missing, no cache to be cleaned."); |
32 | 33 | |
33 | 34 | return; |
34 | 35 | } |
35 | 36 | |
36 | - if ($this->isVerbose()) { |
|
37 | + if ($this->isVerbose()) |
|
38 | + { |
|
37 | 39 | $this->writeln("<info>Cleaning view cache:</info>"); |
38 | 40 | } |
39 | 41 | |
40 | - foreach ($files->getFiles($config->getCacheDirectory()) as $filename) { |
|
41 | - try { |
|
42 | + foreach ($files->getFiles($config->getCacheDirectory()) as $filename) |
|
43 | + { |
|
44 | + try |
|
45 | + { |
|
42 | 46 | $files->delete($filename); |
43 | - } catch (\Throwable $e) { |
|
47 | + } |
|
48 | + catch (\Throwable $e) |
|
49 | + { |
|
44 | 50 | // @codeCoverageIgnoreStart |
45 | 51 | $this->sprintf( |
46 | 52 | "<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n", |
@@ -53,7 +59,8 @@ discard block |
||
53 | 59 | // @codeCoverageIgnoreEnd |
54 | 60 | } |
55 | 61 | |
56 | - if ($this->isVerbose()) { |
|
62 | + if ($this->isVerbose()) |
|
63 | + { |
|
57 | 64 | $this->sprintf( |
58 | 65 | "<fg=green>[deleted]</fg=green> `%s`\n", |
59 | 66 | $files->relativePath($filename, $config->getCacheDirectory()) |
@@ -39,7 +39,8 @@ discard block |
||
39 | 39 | */ |
40 | 40 | public function perform(TranslatorConfig $config, CatalogueManager $manager) |
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 | } |
@@ -12,8 +12,10 @@ |
||
12 | 12 | |
13 | 13 | class ErrorJob extends AbstractJob |
14 | 14 | { |
15 | - public function do() |
|
15 | + public function do{ |
|
16 | + () |
|
16 | 17 | { |
17 | 18 | throw new \ErrorException("bad job"); |
18 | 19 | } |
20 | + } |
|
19 | 21 | } |
@@ -13,8 +13,10 @@ |
||
13 | 13 | |
14 | 14 | class TestJob extends AbstractJob |
15 | 15 | { |
16 | - public function do(EnvironmentInterface $env) |
|
16 | + public function do{ |
|
17 | + (EnvironmentInterface $env) |
|
17 | 18 | { |
18 | 19 | $env->set('FIRED', true); |
19 | 20 | } |
21 | + } |
|
20 | 22 | } |
@@ -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 | $msg = new Message(); |
93 | 98 | $msg->mergeFromString($out); |
94 | 99 | $this->assertSame("hello", $msg->getMsg()); |
@@ -99,7 +104,8 @@ discard block |
||
99 | 104 | |
100 | 105 | // one command only |
101 | 106 | $w->shouldReceive('receive')->once()->with( |
102 | - \Mockery::on(function (&$context) { |
|
107 | + \Mockery::on(function (&$context) |
|
108 | + { |
|
103 | 109 | $context = null; |
104 | 110 | return true; |
105 | 111 | }) |
@@ -119,7 +125,8 @@ discard block |
||
119 | 125 | $msg->setMsg("hello"); |
120 | 126 | |
121 | 127 | $w->shouldReceive('receive')->once()->with( |
122 | - \Mockery::on(function (&$context) { |
|
128 | + \Mockery::on(function (&$context) |
|
129 | + { |
|
123 | 130 | $context = '{ |
124 | 131 | "service": "service.Echo", |
125 | 132 | "method": "Invalid" |
@@ -130,7 +137,8 @@ discard block |
||
130 | 137 | )->andReturn($msg->serializeToString()); |
131 | 138 | |
132 | 139 | $w->shouldReceive('error')->once()->with( |
133 | - \Mockery::on(function ($out) { |
|
140 | + \Mockery::on(function ($out) |
|
141 | + { |
|
134 | 142 | $this->assertContains('Method `Invalid` not found', $out); |
135 | 143 | return true; |
136 | 144 | }) |
@@ -138,7 +146,8 @@ discard block |
||
138 | 146 | |
139 | 147 | // one command only |
140 | 148 | $w->shouldReceive('receive')->once()->with( |
141 | - \Mockery::on(function (&$context) { |
|
149 | + \Mockery::on(function (&$context) |
|
150 | + { |
|
142 | 151 | $context = null; |
143 | 152 | return true; |
144 | 153 | }) |