@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | FinalizerInterface $finalizer, |
47 | 47 | ContainerInterface $container, |
48 | 48 | FactoryInterface $factory |
49 | - ) { |
|
49 | + ){ |
|
50 | 50 | $this->env = $env; |
51 | 51 | $this->finalizer = $finalizer; |
52 | 52 | $this->container = $container; |
@@ -70,12 +70,12 @@ discard block |
||
70 | 70 | |
71 | 71 | /** @var HttpCore $http */ |
72 | 72 | $http = $this->container->get(HttpCore::class); |
73 | - while ($request = $client->acceptRequest()) { |
|
74 | - try { |
|
73 | + while ($request = $client->acceptRequest()){ |
|
74 | + try{ |
|
75 | 75 | $client->respond($http->handle($request)); |
76 | - } catch (\Throwable $e) { |
|
76 | + }catch (\Throwable $e){ |
|
77 | 77 | $this->handleException($client, $e); |
78 | - } finally { |
|
78 | + }finally{ |
|
79 | 79 | $this->finalizer->finalize(false); |
80 | 80 | } |
81 | 81 | } |
@@ -89,11 +89,11 @@ discard block |
||
89 | 89 | { |
90 | 90 | $handler = new HtmlHandler(HtmlHandler::INVERTED); |
91 | 91 | |
92 | - try { |
|
92 | + try{ |
|
93 | 93 | /** @var SnapshotInterface $snapshot */ |
94 | 94 | $snapshot = $this->container->get(SnapshotterInterface::class)->register($e); |
95 | 95 | error_log($snapshot->getMessage()); |
96 | - } catch (\Throwable|ContainerExceptionInterface $se) { |
|
96 | + }catch (\Throwable | ContainerExceptionInterface $se){ |
|
97 | 97 | error_log((string)$e); |
98 | 98 | } |
99 | 99 |
@@ -70,12 +70,18 @@ discard block |
||
70 | 70 | |
71 | 71 | /** @var HttpCore $http */ |
72 | 72 | $http = $this->container->get(HttpCore::class); |
73 | - while ($request = $client->acceptRequest()) { |
|
74 | - try { |
|
73 | + while ($request = $client->acceptRequest()) |
|
74 | + { |
|
75 | + try |
|
76 | + { |
|
75 | 77 | $client->respond($http->handle($request)); |
76 | - } catch (\Throwable $e) { |
|
78 | + } |
|
79 | + catch (\Throwable $e) |
|
80 | + { |
|
77 | 81 | $this->handleException($client, $e); |
78 | - } finally { |
|
82 | + } |
|
83 | + finally |
|
84 | + { |
|
79 | 85 | $this->finalizer->finalize(false); |
80 | 86 | } |
81 | 87 | } |
@@ -89,11 +95,14 @@ discard block |
||
89 | 95 | { |
90 | 96 | $handler = new HtmlHandler(HtmlHandler::INVERTED); |
91 | 97 | |
92 | - try { |
|
98 | + try |
|
99 | + { |
|
93 | 100 | /** @var SnapshotInterface $snapshot */ |
94 | 101 | $snapshot = $this->container->get(SnapshotterInterface::class)->register($e); |
95 | 102 | error_log($snapshot->getMessage()); |
96 | - } catch (\Throwable|ContainerExceptionInterface $se) { |
|
103 | + } |
|
104 | + catch (\Throwable|ContainerExceptionInterface $se) |
|
105 | + { |
|
97 | 106 | error_log((string)$e); |
98 | 107 | } |
99 | 108 |
@@ -51,31 +51,31 @@ discard block |
||
51 | 51 | '<fg=magenta>[runtime]</fg=magenta> <fg=cyan>verify `runtime` directory access</fg=cyan>' |
52 | 52 | ); |
53 | 53 | |
54 | - if ($container->has(DatabaseProviderInterface::class)) { |
|
54 | + if ($container->has(DatabaseProviderInterface::class)){ |
|
55 | 55 | $this->configureDatabase($console); |
56 | 56 | } |
57 | 57 | |
58 | - if ($container->has(ORMInterface::class)) { |
|
58 | + if ($container->has(ORMInterface::class)){ |
|
59 | 59 | $this->configureCycle($console, $container); |
60 | 60 | } |
61 | 61 | |
62 | - if ($container->has(TranslatorInterface::class)) { |
|
62 | + if ($container->has(TranslatorInterface::class)){ |
|
63 | 63 | $this->configureTranslator($console); |
64 | 64 | } |
65 | 65 | |
66 | - if ($container->has(ViewsInterface::class)) { |
|
66 | + if ($container->has(ViewsInterface::class)){ |
|
67 | 67 | $this->configureViews($console); |
68 | 68 | } |
69 | 69 | |
70 | - if ($container->has(Migrator::class)) { |
|
70 | + if ($container->has(Migrator::class)){ |
|
71 | 71 | $this->configureMigrations($console); |
72 | 72 | } |
73 | 73 | |
74 | - if ($container->has(InvokerInterface::class)) { |
|
74 | + if ($container->has(InvokerInterface::class)){ |
|
75 | 75 | $this->configureGRPC($console); |
76 | 76 | } |
77 | 77 | |
78 | - if ($container->has(EncryptionInterface::class)) { |
|
78 | + if ($container->has(EncryptionInterface::class)){ |
|
79 | 79 | $this->configureEncrypter($console); |
80 | 80 | } |
81 | 81 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | $console->addCommand(Cycle\SyncCommand::class); |
116 | 116 | |
117 | - if ($container->has(Migrator::class)) { |
|
117 | + if ($container->has(Migrator::class)){ |
|
118 | 118 | $console->addCommand(Cycle\MigrateCommand::class); |
119 | 119 | } |
120 | 120 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $console->addCommand(Translator\ResetCommand::class); |
130 | 130 | |
131 | 131 | $console->addConfigureSequence( |
132 | - function (FilesInterface $files, TranslatorConfig $config, OutputInterface $output) { |
|
132 | + function (FilesInterface $files, TranslatorConfig $config, OutputInterface $output){ |
|
133 | 133 | $files->ensureDirectory($config->getLocaleDirectory($config->getDefaultLocale())); |
134 | 134 | $output->writeln("<info>The default locale directory has been ensured.</info>"); |
135 | 135 | }, |
@@ -51,31 +51,38 @@ discard block |
||
51 | 51 | '<fg=magenta>[runtime]</fg=magenta> <fg=cyan>verify `runtime` directory access</fg=cyan>' |
52 | 52 | ); |
53 | 53 | |
54 | - if ($container->has(DatabaseProviderInterface::class)) { |
|
54 | + if ($container->has(DatabaseProviderInterface::class)) |
|
55 | + { |
|
55 | 56 | $this->configureDatabase($console); |
56 | 57 | } |
57 | 58 | |
58 | - if ($container->has(ORMInterface::class)) { |
|
59 | + if ($container->has(ORMInterface::class)) |
|
60 | + { |
|
59 | 61 | $this->configureCycle($console, $container); |
60 | 62 | } |
61 | 63 | |
62 | - if ($container->has(TranslatorInterface::class)) { |
|
64 | + if ($container->has(TranslatorInterface::class)) |
|
65 | + { |
|
63 | 66 | $this->configureTranslator($console); |
64 | 67 | } |
65 | 68 | |
66 | - if ($container->has(ViewsInterface::class)) { |
|
69 | + if ($container->has(ViewsInterface::class)) |
|
70 | + { |
|
67 | 71 | $this->configureViews($console); |
68 | 72 | } |
69 | 73 | |
70 | - if ($container->has(Migrator::class)) { |
|
74 | + if ($container->has(Migrator::class)) |
|
75 | + { |
|
71 | 76 | $this->configureMigrations($console); |
72 | 77 | } |
73 | 78 | |
74 | - if ($container->has(InvokerInterface::class)) { |
|
79 | + if ($container->has(InvokerInterface::class)) |
|
80 | + { |
|
75 | 81 | $this->configureGRPC($console); |
76 | 82 | } |
77 | 83 | |
78 | - if ($container->has(EncryptionInterface::class)) { |
|
84 | + if ($container->has(EncryptionInterface::class)) |
|
85 | + { |
|
79 | 86 | $this->configureEncrypter($console); |
80 | 87 | } |
81 | 88 | } |
@@ -114,7 +121,8 @@ discard block |
||
114 | 121 | |
115 | 122 | $console->addCommand(Cycle\SyncCommand::class); |
116 | 123 | |
117 | - if ($container->has(Migrator::class)) { |
|
124 | + if ($container->has(Migrator::class)) |
|
125 | + { |
|
118 | 126 | $console->addCommand(Cycle\MigrateCommand::class); |
119 | 127 | } |
120 | 128 | } |
@@ -129,7 +137,8 @@ discard block |
||
129 | 137 | $console->addCommand(Translator\ResetCommand::class); |
130 | 138 | |
131 | 139 | $console->addConfigureSequence( |
132 | - function (FilesInterface $files, TranslatorConfig $config, OutputInterface $output) { |
|
140 | + function (FilesInterface $files, TranslatorConfig $config, OutputInterface $output) |
|
141 | + { |
|
133 | 142 | $files->ensureDirectory($config->getLocaleDirectory($config->getDefaultLocale())); |
134 | 143 | $output->writeln("<info>The default locale directory has been ensured.</info>"); |
135 | 144 | }, |
@@ -36,21 +36,21 @@ |
||
36 | 36 | { |
37 | 37 | $conn = $env->get('RR_RPC', static::RPC_DEFAULT); |
38 | 38 | |
39 | - if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) { |
|
39 | + if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)){ |
|
40 | 40 | throw new BootException( |
41 | 41 | "Unable to configure RPC connection, invalid DSN given `{$conn}`." |
42 | 42 | ); |
43 | 43 | } |
44 | 44 | |
45 | - if (!in_array($parts[1], ['tcp', 'unix'])) { |
|
45 | + if (!in_array($parts[1], ['tcp', 'unix'])){ |
|
46 | 46 | throw new BootException( |
47 | 47 | "Unable to configure RPC connection, invalid DSN given `{$conn}`." |
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | - if ($parts[1] == 'unix') { |
|
51 | + if ($parts[1] == 'unix'){ |
|
52 | 52 | $relay = new SocketRelay($parts[2], null, SocketRelay::SOCK_UNIX); |
53 | - } else { |
|
53 | + }else{ |
|
54 | 54 | $relay = new SocketRelay($parts[2], (int)$parts[3], SocketRelay::SOCK_TCP); |
55 | 55 | } |
56 | 56 |
@@ -36,21 +36,26 @@ |
||
36 | 36 | { |
37 | 37 | $conn = $env->get('RR_RPC', static::RPC_DEFAULT); |
38 | 38 | |
39 | - if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) { |
|
39 | + if (!preg_match('#^([a-z]+)://([^:]+):?(\d+)?$#i', $conn, $parts)) |
|
40 | + { |
|
40 | 41 | throw new BootException( |
41 | 42 | "Unable to configure RPC connection, invalid DSN given `{$conn}`." |
42 | 43 | ); |
43 | 44 | } |
44 | 45 | |
45 | - if (!in_array($parts[1], ['tcp', 'unix'])) { |
|
46 | + if (!in_array($parts[1], ['tcp', 'unix'])) |
|
47 | + { |
|
46 | 48 | throw new BootException( |
47 | 49 | "Unable to configure RPC connection, invalid DSN given `{$conn}`." |
48 | 50 | ); |
49 | 51 | } |
50 | 52 | |
51 | - if ($parts[1] == 'unix') { |
|
53 | + if ($parts[1] == 'unix') |
|
54 | + { |
|
52 | 55 | $relay = new SocketRelay($parts[2], null, SocketRelay::SOCK_UNIX); |
53 | - } else { |
|
56 | + } |
|
57 | + else |
|
58 | + { |
|
54 | 59 | $relay = new SocketRelay($parts[2], (int)$parts[3], SocketRelay::SOCK_TCP); |
55 | 60 | } |
56 | 61 |
@@ -35,11 +35,11 @@ |
||
35 | 35 | */ |
36 | 36 | public function createInjection(\ReflectionClass $class, string $context = null) |
37 | 37 | { |
38 | - if (!$this->orm->getSchema()->defines($context)) { |
|
38 | + if (!$this->orm->getSchema()->defines($context)){ |
|
39 | 39 | $context = Inflector::singularize($context); |
40 | 40 | } |
41 | 41 | |
42 | - if (!$this->orm->getSchema()->defines($context)) { |
|
42 | + if (!$this->orm->getSchema()->defines($context)){ |
|
43 | 43 | throw new ORMException("Cycle schema is not initiated or role missing, run `cycle`"); |
44 | 44 | } |
45 | 45 |
@@ -35,11 +35,13 @@ |
||
35 | 35 | */ |
36 | 36 | public function createInjection(\ReflectionClass $class, string $context = null) |
37 | 37 | { |
38 | - if (!$this->orm->getSchema()->defines($context)) { |
|
38 | + if (!$this->orm->getSchema()->defines($context)) |
|
39 | + { |
|
39 | 40 | $context = Inflector::singularize($context); |
40 | 41 | } |
41 | 42 | |
42 | - if (!$this->orm->getSchema()->defines($context)) { |
|
43 | + if (!$this->orm->getSchema()->defines($context)) |
|
44 | + { |
|
43 | 45 | throw new ORMException("Cycle schema is not initiated or role missing, run `cycle`"); |
44 | 46 | } |
45 | 47 |
@@ -26,20 +26,20 @@ 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 | $this->writeln("Cache directory is missing, no cache to be cleaned."); |
31 | 31 | |
32 | 32 | return; |
33 | 33 | } |
34 | 34 | |
35 | - if ($this->isVerbose()) { |
|
35 | + if ($this->isVerbose()){ |
|
36 | 36 | $this->writeln("<info>Cleaning application cache:</info>"); |
37 | 37 | } |
38 | 38 | |
39 | - foreach ($files->getFiles($cacheDirectory) as $filename) { |
|
40 | - try { |
|
39 | + foreach ($files->getFiles($cacheDirectory) as $filename){ |
|
40 | + try{ |
|
41 | 41 | $files->delete($filename); |
42 | - } catch (\Throwable $e) { |
|
42 | + }catch (\Throwable $e){ |
|
43 | 43 | // @codeCoverageIgnoreStart |
44 | 44 | $this->sprintf("<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n", |
45 | 45 | $files->relativePath($filename, $cacheDirectory), |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | // @codeCoverageIgnoreEnd |
51 | 51 | } |
52 | 52 | |
53 | - if ($this->isVerbose()) { |
|
53 | + if ($this->isVerbose()){ |
|
54 | 54 | $this->sprintf( |
55 | 55 | "<fg=green>[deleted]</fg=green> `%s`\n", |
56 | 56 | $files->relativePath($filename, $cacheDirectory) |
@@ -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("<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>\n", |
45 | 51 | $files->relativePath($filename, $cacheDirectory), |
@@ -50,7 +56,8 @@ discard block |
||
50 | 56 | // @codeCoverageIgnoreEnd |
51 | 57 | } |
52 | 58 | |
53 | - if ($this->isVerbose()) { |
|
59 | + if ($this->isVerbose()) |
|
60 | + { |
|
54 | 61 | $this->sprintf( |
55 | 62 | "<fg=green>[deleted]</fg=green> `%s`\n", |
56 | 63 | $files->relativePath($filename, $cacheDirectory) |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | { |
25 | 25 | $services = $locator->getServices(); |
26 | 26 | |
27 | - if ($services === []) { |
|
27 | + if ($services === []){ |
|
28 | 28 | $this->writeln("<comment>No GRPC services were found.</comment>"); |
29 | 29 | return; |
30 | 30 | } |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | 'File:', |
36 | 36 | ]); |
37 | 37 | |
38 | - foreach ($services as $interface => $instance) { |
|
38 | + foreach ($services as $interface => $instance){ |
|
39 | 39 | $grid->addRow([ |
40 | 40 | $interface::NAME, |
41 | 41 | get_class($instance), |
@@ -24,7 +24,8 @@ discard block |
||
24 | 24 | { |
25 | 25 | $services = $locator->getServices(); |
26 | 26 | |
27 | - if ($services === []) { |
|
27 | + if ($services === []) |
|
28 | + { |
|
28 | 29 | $this->writeln("<comment>No GRPC services were found.</comment>"); |
29 | 30 | return; |
30 | 31 | } |
@@ -35,7 +36,8 @@ discard block |
||
35 | 36 | 'File:', |
36 | 37 | ]); |
37 | 38 | |
38 | - foreach ($services as $interface => $instance) { |
|
39 | + foreach ($services as $interface => $instance) |
|
40 | + { |
|
39 | 41 | $grid->addRow([ |
40 | 42 | $interface::NAME, |
41 | 43 | get_class($instance), |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | public function perform(KernelInterface $kernel, FilesInterface $files, DirectoriesInterface $dirs) |
40 | 40 | { |
41 | 41 | $protoFile = $this->argument('proto'); |
42 | - if (!file_exists($protoFile)) { |
|
42 | + if (!file_exists($protoFile)){ |
|
43 | 43 | $this->sprintf("<error>File `%s` not found.</error>", $protoFile); |
44 | 44 | return; |
45 | 45 | } |
@@ -52,19 +52,19 @@ discard block |
||
52 | 52 | |
53 | 53 | $this->sprintf("<info>Compiling <fg=cyan>`%s`</fg=cyan>:</info>\n", $protoFile); |
54 | 54 | |
55 | - try { |
|
55 | + try{ |
|
56 | 56 | $result = $compiler->compile($protoFile); |
57 | - } catch (\Throwable $e) { |
|
57 | + }catch (\Throwable $e){ |
|
58 | 58 | $this->sprintf("<error>Error:</error> <fg=red>%s</fg=red>\n", $e->getMessage()); |
59 | 59 | return; |
60 | 60 | } |
61 | 61 | |
62 | - if ($result === []) { |
|
62 | + if ($result === []){ |
|
63 | 63 | $this->sprintf("<info>No files were generated.</info>\n", $protoFile); |
64 | 64 | return; |
65 | 65 | } |
66 | 66 | |
67 | - foreach ($result as $file) { |
|
67 | + foreach ($result as $file){ |
|
68 | 68 | $this->sprintf( |
69 | 69 | "<fg=green>•</fg=green> %s%s%s\n", |
70 | 70 | Color::LIGHT_WHITE, |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | protected function getPath(KernelInterface $kernel): string |
84 | 84 | { |
85 | 85 | $path = $this->argument('namespace'); |
86 | - if ($path !== 'auto') { |
|
86 | + if ($path !== 'auto'){ |
|
87 | 87 | return $path; |
88 | 88 | } |
89 | 89 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | protected function getNamespace(KernelInterface $kernel): string |
102 | 102 | { |
103 | 103 | $namespace = $this->argument('namespace'); |
104 | - if ($namespace !== 'auto') { |
|
104 | + if ($namespace !== 'auto'){ |
|
105 | 105 | return $namespace; |
106 | 106 | } |
107 | 107 |
@@ -39,7 +39,8 @@ discard block |
||
39 | 39 | public function perform(KernelInterface $kernel, FilesInterface $files, DirectoriesInterface $dirs) |
40 | 40 | { |
41 | 41 | $protoFile = $this->argument('proto'); |
42 | - if (!file_exists($protoFile)) { |
|
42 | + if (!file_exists($protoFile)) |
|
43 | + { |
|
43 | 44 | $this->sprintf("<error>File `%s` not found.</error>", $protoFile); |
44 | 45 | return; |
45 | 46 | } |
@@ -52,19 +53,24 @@ discard block |
||
52 | 53 | |
53 | 54 | $this->sprintf("<info>Compiling <fg=cyan>`%s`</fg=cyan>:</info>\n", $protoFile); |
54 | 55 | |
55 | - try { |
|
56 | + try |
|
57 | + { |
|
56 | 58 | $result = $compiler->compile($protoFile); |
57 | - } catch (\Throwable $e) { |
|
59 | + } |
|
60 | + catch (\Throwable $e) |
|
61 | + { |
|
58 | 62 | $this->sprintf("<error>Error:</error> <fg=red>%s</fg=red>\n", $e->getMessage()); |
59 | 63 | return; |
60 | 64 | } |
61 | 65 | |
62 | - if ($result === []) { |
|
66 | + if ($result === []) |
|
67 | + { |
|
63 | 68 | $this->sprintf("<info>No files were generated.</info>\n", $protoFile); |
64 | 69 | return; |
65 | 70 | } |
66 | 71 | |
67 | - foreach ($result as $file) { |
|
72 | + foreach ($result as $file) |
|
73 | + { |
|
68 | 74 | $this->sprintf( |
69 | 75 | "<fg=green>•</fg=green> %s%s%s\n", |
70 | 76 | Color::LIGHT_WHITE, |
@@ -83,7 +89,8 @@ discard block |
||
83 | 89 | protected function getPath(KernelInterface $kernel): string |
84 | 90 | { |
85 | 91 | $path = $this->argument('namespace'); |
86 | - if ($path !== 'auto') { |
|
92 | + if ($path !== 'auto') |
|
93 | + { |
|
87 | 94 | return $path; |
88 | 95 | } |
89 | 96 | |
@@ -101,7 +108,8 @@ discard block |
||
101 | 108 | protected function getNamespace(KernelInterface $kernel): string |
102 | 109 | { |
103 | 110 | $namespace = $this->argument('namespace'); |
104 | - if ($namespace !== 'auto') { |
|
111 | + if ($namespace !== 'auto') |
|
112 | + { |
|
105 | 113 | return $namespace; |
106 | 114 | } |
107 | 115 |
@@ -58,21 +58,21 @@ |
||
58 | 58 | ); |
59 | 59 | |
60 | 60 | $file = $this->option('mount'); |
61 | - if ($file === null) { |
|
61 | + if ($file === null){ |
|
62 | 62 | return; |
63 | 63 | } |
64 | 64 | |
65 | - if (!$files->exists($file)) { |
|
65 | + if (!$files->exists($file)){ |
|
66 | 66 | $this->sprintf("<error>Unable to find `%s`</error>", $file); |
67 | 67 | return; |
68 | 68 | } |
69 | 69 | |
70 | 70 | $content = $files->read($file); |
71 | 71 | |
72 | - try { |
|
72 | + try{ |
|
73 | 73 | $content = str_replace($this->option('placeholder'), $key, $content); |
74 | 74 | $content = str_replace($enc->getKey(), $key, $content); |
75 | - } catch (\Throwable $e) { |
|
75 | + }catch (\Throwable $e){ |
|
76 | 76 | // current keys is not set |
77 | 77 | } |
78 | 78 |
@@ -58,21 +58,26 @@ |
||
58 | 58 | ); |
59 | 59 | |
60 | 60 | $file = $this->option('mount'); |
61 | - if ($file === null) { |
|
61 | + if ($file === null) |
|
62 | + { |
|
62 | 63 | return; |
63 | 64 | } |
64 | 65 | |
65 | - if (!$files->exists($file)) { |
|
66 | + if (!$files->exists($file)) |
|
67 | + { |
|
66 | 68 | $this->sprintf("<error>Unable to find `%s`</error>", $file); |
67 | 69 | return; |
68 | 70 | } |
69 | 71 | |
70 | 72 | $content = $files->read($file); |
71 | 73 | |
72 | - try { |
|
74 | + try |
|
75 | + { |
|
73 | 76 | $content = str_replace($this->option('placeholder'), $key, $content); |
74 | 77 | $content = str_replace($enc->getKey(), $key, $content); |
75 | - } catch (\Throwable $e) { |
|
78 | + } |
|
79 | + catch (\Throwable $e) |
|
80 | + { |
|
76 | 81 | // current keys is not set |
77 | 82 | } |
78 | 83 |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | GenerateMigrations $migrations, |
49 | 49 | Migrator $migrator, |
50 | 50 | Console $console |
51 | - ) { |
|
52 | - if (!$this->verifyConfigured()) { |
|
51 | + ){ |
|
52 | + if (!$this->verifyConfigured()){ |
|
53 | 53 | return; |
54 | 54 | } |
55 | 55 | |
56 | - foreach ($migrator->getMigrations() as $migration) { |
|
57 | - if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED) { |
|
56 | + foreach ($migrator->getMigrations() as $migration){ |
|
57 | + if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED){ |
|
58 | 58 | $this->writeln("<fg=red>Outstanding migrations found, run `migrate` first.</fg=red>"); |
59 | 59 | return; |
60 | 60 | } |
@@ -69,10 +69,10 @@ discard block |
||
69 | 69 | |
70 | 70 | $memory->saveData('cycle', $schema); |
71 | 71 | |
72 | - if ($show->hasChanges()) { |
|
72 | + if ($show->hasChanges()){ |
|
73 | 73 | (new Compiler())->compile($registry, [$migrations]); |
74 | 74 | |
75 | - if ($this->option('run')) { |
|
75 | + if ($this->option('run')){ |
|
76 | 76 | $console->run('migrate', [], $this->output); |
77 | 77 | } |
78 | 78 | } |
@@ -49,12 +49,15 @@ discard block |
||
49 | 49 | Migrator $migrator, |
50 | 50 | Console $console |
51 | 51 | ) { |
52 | - if (!$this->verifyConfigured()) { |
|
52 | + if (!$this->verifyConfigured()) |
|
53 | + { |
|
53 | 54 | return; |
54 | 55 | } |
55 | 56 | |
56 | - foreach ($migrator->getMigrations() as $migration) { |
|
57 | - if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED) { |
|
57 | + foreach ($migrator->getMigrations() as $migration) |
|
58 | + { |
|
59 | + if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED) |
|
60 | + { |
|
58 | 61 | $this->writeln("<fg=red>Outstanding migrations found, run `migrate` first.</fg=red>"); |
59 | 62 | return; |
60 | 63 | } |
@@ -69,10 +72,12 @@ discard block |
||
69 | 72 | |
70 | 73 | $memory->saveData('cycle', $schema); |
71 | 74 | |
72 | - if ($show->hasChanges()) { |
|
75 | + if ($show->hasChanges()) |
|
76 | + { |
|
73 | 77 | (new Compiler())->compile($registry, [$migrations]); |
74 | 78 | |
75 | - if ($this->option('run')) { |
|
79 | + if ($this->option('run')) |
|
80 | + { |
|
76 | 81 | $console->run('migrate', [], $this->output); |
77 | 82 | } |
78 | 83 | } |