Passed
Push — master ( 8b6293...069289 )
by Anton
04:46 queued 02:28
created
src/Command/GRPC/ListCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $services = $locator->getServices();
27 27
 
28
-        if ($services === []) {
28
+        if ($services === []){
29 29
             $this->writeln('<comment>No GRPC services were found.</comment>');
30 30
             return;
31 31
         }
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
             'File:',
37 37
         ]);
38 38
 
39
-        foreach ($services as $interface => $instance) {
39
+        foreach ($services as $interface => $instance){
40 40
             $grid->addRow([
41 41
                 $interface::NAME,
42 42
                 get_class($instance),
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -25,7 +25,8 @@  discard block
 block discarded – undo
25 25
     {
26 26
         $services = $locator->getServices();
27 27
 
28
-        if ($services === []) {
28
+        if ($services === [])
29
+        {
29 30
             $this->writeln('<comment>No GRPC services were found.</comment>');
30 31
             return;
31 32
         }
@@ -36,7 +37,8 @@  discard block
 block discarded – undo
36 37
             'File:',
37 38
         ]);
38 39
 
39
-        foreach ($services as $interface => $instance) {
40
+        foreach ($services as $interface => $instance)
41
+        {
40 42
             $grid->addRow([
41 43
                 $interface::NAME,
42 44
                 get_class($instance),
Please login to merge, or discard this patch.
src/Command/GRPC/GenerateCommand.php 2 patches
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
     public function perform(KernelInterface $kernel, FilesInterface $files, DirectoriesInterface $dirs): void
41 41
     {
42 42
         $protoFile = $this->argument('proto');
43
-        if (!file_exists($protoFile)) {
43
+        if (!file_exists($protoFile)){
44 44
             $this->sprintf('<error>File `%s` not found.</error>', $protoFile);
45 45
             return;
46 46
         }
@@ -53,19 +53,19 @@  discard block
 block discarded – undo
53 53
 
54 54
         $this->sprintf("<info>Compiling <fg=cyan>`%s`</fg=cyan>:</info>\n", $protoFile);
55 55
 
56
-        try {
56
+        try{
57 57
             $result = $compiler->compile($protoFile);
58
-        } catch (\Throwable $e) {
58
+        }catch (\Throwable $e){
59 59
             $this->sprintf("<error>Error:</error> <fg=red>%s</fg=red>\n", $e->getMessage());
60 60
             return;
61 61
         }
62 62
 
63
-        if ($result === []) {
63
+        if ($result === []){
64 64
             $this->sprintf("<info>No files were generated.</info>\n", $protoFile);
65 65
             return;
66 66
         }
67 67
 
68
-        foreach ($result as $file) {
68
+        foreach ($result as $file){
69 69
             $this->sprintf(
70 70
                 "<fg=green>•</fg=green> %s%s%s\n",
71 71
                 Color::LIGHT_WHITE,
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     protected function getPath(KernelInterface $kernel): string
85 85
     {
86 86
         $path = $this->argument('namespace');
87
-        if ($path !== 'auto') {
87
+        if ($path !== 'auto'){
88 88
             return $path;
89 89
         }
90 90
 
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
     protected function getNamespace(KernelInterface $kernel): string
103 103
     {
104 104
         $namespace = $this->argument('namespace');
105
-        if ($namespace !== 'auto') {
105
+        if ($namespace !== 'auto'){
106 106
             return $namespace;
107 107
         }
108 108
 
Please login to merge, or discard this patch.
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@  discard block
 block discarded – undo
40 40
     public function perform(KernelInterface $kernel, FilesInterface $files, DirectoriesInterface $dirs): void
41 41
     {
42 42
         $protoFile = $this->argument('proto');
43
-        if (!file_exists($protoFile)) {
43
+        if (!file_exists($protoFile))
44
+        {
44 45
             $this->sprintf('<error>File `%s` not found.</error>', $protoFile);
45 46
             return;
46 47
         }
@@ -53,19 +54,24 @@  discard block
 block discarded – undo
53 54
 
54 55
         $this->sprintf("<info>Compiling <fg=cyan>`%s`</fg=cyan>:</info>\n", $protoFile);
55 56
 
56
-        try {
57
+        try
58
+        {
57 59
             $result = $compiler->compile($protoFile);
58
-        } catch (\Throwable $e) {
60
+        }
61
+        catch (\Throwable $e)
62
+        {
59 63
             $this->sprintf("<error>Error:</error> <fg=red>%s</fg=red>\n", $e->getMessage());
60 64
             return;
61 65
         }
62 66
 
63
-        if ($result === []) {
67
+        if ($result === [])
68
+        {
64 69
             $this->sprintf("<info>No files were generated.</info>\n", $protoFile);
65 70
             return;
66 71
         }
67 72
 
68
-        foreach ($result as $file) {
73
+        foreach ($result as $file)
74
+        {
69 75
             $this->sprintf(
70 76
                 "<fg=green>•</fg=green> %s%s%s\n",
71 77
                 Color::LIGHT_WHITE,
@@ -84,7 +90,8 @@  discard block
 block discarded – undo
84 90
     protected function getPath(KernelInterface $kernel): string
85 91
     {
86 92
         $path = $this->argument('namespace');
87
-        if ($path !== 'auto') {
93
+        if ($path !== 'auto')
94
+        {
88 95
             return $path;
89 96
         }
90 97
 
@@ -102,7 +109,8 @@  discard block
 block discarded – undo
102 109
     protected function getNamespace(KernelInterface $kernel): string
103 110
     {
104 111
         $namespace = $this->argument('namespace');
105
-        if ($namespace !== 'auto') {
112
+        if ($namespace !== 'auto')
113
+        {
106 114
             return $namespace;
107 115
         }
108 116
 
Please login to merge, or discard this patch.
src/Command/Encrypter/KeyCommand.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,21 +55,21 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,21 +55,26 @@
 block discarded – undo
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
 
Please login to merge, or discard this patch.
src/Console/Sequence/RuntimeDirectory.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 
45 45
         $runtimeDirectory = $this->dirs->get('runtime');
46 46
 
47
-        if (!$this->files->exists($runtimeDirectory)) {
47
+        if (!$this->files->exists($runtimeDirectory)){
48 48
             $this->files->ensureDirectory($runtimeDirectory);
49 49
             $output->writeln('<comment>created</comment>');
50 50
             return;
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
         $output->writeln('<info>exists</info>');
53 53
         
54 54
 
55
-        foreach ($this->files->getFiles($runtimeDirectory) as $filename) {
56
-            try {
55
+        foreach ($this->files->getFiles($runtimeDirectory) as $filename){
56
+            try{
57 57
                 $this->files->setPermissions($filename, FilesInterface::RUNTIME);
58 58
                 $this->files->setPermissions(dirname($filename), FilesInterface::RUNTIME);
59
-            } catch (\Throwable $e) {
59
+            }catch (\Throwable $e){
60 60
                 // @codeCoverageIgnoreStart
61 61
                 $output->writeln(sprintf(
62 62
                     '<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>',
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
                 // @codeCoverageIgnoreEnd
68 68
             }
69 69
 
70
-            if ($output->isVerbose()) {
70
+            if ($output->isVerbose()){
71 71
                 $output->writeln(sprintf(
72 72
                     '<fg=green>[updated]</fg=green> `%s`',
73 73
                     $this->files->relativePath($filename, $runtimeDirectory)
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -44,7 +44,8 @@  discard block
 block discarded – undo
44 44
 
45 45
         $runtimeDirectory = $this->dirs->get('runtime');
46 46
 
47
-        if (!$this->files->exists($runtimeDirectory)) {
47
+        if (!$this->files->exists($runtimeDirectory))
48
+        {
48 49
             $this->files->ensureDirectory($runtimeDirectory);
49 50
             $output->writeln('<comment>created</comment>');
50 51
             return;
@@ -52,11 +53,15 @@  discard block
 block discarded – undo
52 53
         $output->writeln('<info>exists</info>');
53 54
         
54 55
 
55
-        foreach ($this->files->getFiles($runtimeDirectory) as $filename) {
56
-            try {
56
+        foreach ($this->files->getFiles($runtimeDirectory) as $filename)
57
+        {
58
+            try
59
+            {
57 60
                 $this->files->setPermissions($filename, FilesInterface::RUNTIME);
58 61
                 $this->files->setPermissions(dirname($filename), FilesInterface::RUNTIME);
59
-            } catch (\Throwable $e) {
62
+            }
63
+            catch (\Throwable $e)
64
+            {
60 65
                 // @codeCoverageIgnoreStart
61 66
                 $output->writeln(sprintf(
62 67
                     '<fg=red>[errored]</fg=red> `%s`: <fg=red>%s</fg=red>',
@@ -67,7 +72,8 @@  discard block
 block discarded – undo
67 72
                 // @codeCoverageIgnoreEnd
68 73
             }
69 74
 
70
-            if ($output->isVerbose()) {
75
+            if ($output->isVerbose())
76
+            {
71 77
                 $output->writeln(sprintf(
72 78
                     '<fg=green>[updated]</fg=green> `%s`',
73 79
                     $this->files->relativePath($filename, $runtimeDirectory)
Please login to merge, or discard this patch.
src/Console/ConsoleDispatcher.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         EnvironmentInterface $env,
48 48
         FinalizerInterface $finalizer,
49 49
         ContainerInterface $container
50
-    ) {
50
+    ){
51 51
         $this->env = $env;
52 52
         $this->finalizer = $finalizer;
53 53
         $this->container = $container;
@@ -76,11 +76,11 @@  discard block
 block discarded – undo
76 76
         /** @var Console $console */
77 77
         $console = $this->container->get(Console::class);
78 78
 
79
-        try {
79
+        try{
80 80
             $console->start($input ?? new ArgvInput(), $output);
81
-        } catch (\Throwable $e) {
81
+        }catch (\Throwable $e){
82 82
             $this->handleException($e, $output);
83
-        } finally {
83
+        }finally{
84 84
             $listener->disable();
85 85
             $this->finalizer->finalize(false);
86 86
         }
@@ -92,9 +92,9 @@  discard block
 block discarded – undo
92 92
      */
93 93
     protected function handleException(\Throwable $e, OutputInterface $output): void
94 94
     {
95
-        try {
95
+        try{
96 96
             $this->container->get(SnapshotterInterface::class)->register($e);
97
-        } catch (\Throwable | ContainerExceptionInterface $se) {
97
+        }catch (\Throwable | ContainerExceptionInterface $se){
98 98
             // no need to notify when unable to register an exception
99 99
         }
100 100
 
@@ -109,11 +109,11 @@  discard block
 block discarded – undo
109 109
      */
110 110
     private function mapVerbosity(OutputInterface $output): int
111 111
     {
112
-        if ($output->isDebug()) {
112
+        if ($output->isDebug()){
113 113
             return ConsoleHandler::VERBOSITY_DEBUG;
114 114
         }
115 115
 
116
-        if ($output->isVeryVerbose()) {
116
+        if ($output->isVeryVerbose()){
117 117
             return ConsoleHandler::VERBOSITY_VERBOSE;
118 118
         }
119 119
 
Please login to merge, or discard this patch.
Braces   +17 added lines, -7 removed lines patch added patch discarded remove patch
@@ -76,11 +76,16 @@  discard block
 block discarded – undo
76 76
         /** @var Console $console */
77 77
         $console = $this->container->get(Console::class);
78 78
 
79
-        try {
79
+        try
80
+        {
80 81
             $console->start($input ?? new ArgvInput(), $output);
81
-        } catch (\Throwable $e) {
82
+        }
83
+        catch (\Throwable $e)
84
+        {
82 85
             $this->handleException($e, $output);
83
-        } finally {
86
+        }
87
+        finally
88
+        {
84 89
             $listener->disable();
85 90
             $this->finalizer->finalize(false);
86 91
         }
@@ -92,9 +97,12 @@  discard block
 block discarded – undo
92 97
      */
93 98
     protected function handleException(\Throwable $e, OutputInterface $output): void
94 99
     {
95
-        try {
100
+        try
101
+        {
96 102
             $this->container->get(SnapshotterInterface::class)->register($e);
97
-        } catch (\Throwable | ContainerExceptionInterface $se) {
103
+        }
104
+        catch (\Throwable | ContainerExceptionInterface $se)
105
+        {
98 106
             // no need to notify when unable to register an exception
99 107
         }
100 108
 
@@ -109,11 +117,13 @@  discard block
 block discarded – undo
109 117
      */
110 118
     private function mapVerbosity(OutputInterface $output): int
111 119
     {
112
-        if ($output->isDebug()) {
120
+        if ($output->isDebug())
121
+        {
113 122
             return ConsoleHandler::VERBOSITY_DEBUG;
114 123
         }
115 124
 
116
-        if ($output->isVeryVerbose()) {
125
+        if ($output->isVeryVerbose())
126
+        {
117 127
             return ConsoleHandler::VERBOSITY_VERBOSE;
118 128
         }
119 129
 
Please login to merge, or discard this patch.
src/Jobs/JobDispatcher.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         EnvironmentInterface $env,
39 39
         FinalizerInterface $finalizer,
40 40
         ContainerInterface $container
41
-    ) {
41
+    ){
42 42
         $this->env = $env;
43 43
         $this->finalizer = $finalizer;
44 44
         $this->container = $container;
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         $worker = $this->container->get(Worker::class);
66 66
 
67 67
         $consumer->serve($worker, function (\Throwable $e = null): void {
68
-            if ($e !== null) {
68
+            if ($e !== null){
69 69
                 $this->handleException($e);
70 70
             }
71 71
 
@@ -78,9 +78,9 @@  discard block
 block discarded – undo
78 78
      */
79 79
     protected function handleException(\Throwable $e): void
80 80
     {
81
-        try {
81
+        try{
82 82
             $this->container->get(SnapshotterInterface::class)->register($e);
83
-        } catch (\Throwable | ContainerExceptionInterface $se) {
83
+        }catch (\Throwable | ContainerExceptionInterface $se){
84 84
             // no need to notify when unable to register an exception
85 85
         }
86 86
     }
Please login to merge, or discard this patch.
Braces   +7 added lines, -3 removed lines patch added patch discarded remove patch
@@ -65,7 +65,8 @@  discard block
 block discarded – undo
65 65
         $worker = $this->container->get(Worker::class);
66 66
 
67 67
         $consumer->serve($worker, function (\Throwable $e = null): void {
68
-            if ($e !== null) {
68
+            if ($e !== null)
69
+            {
69 70
                 $this->handleException($e);
70 71
             }
71 72
 
@@ -78,9 +79,12 @@  discard block
 block discarded – undo
78 79
      */
79 80
     protected function handleException(\Throwable $e): void
80 81
     {
81
-        try {
82
+        try
83
+        {
82 84
             $this->container->get(SnapshotterInterface::class)->register($e);
83
-        } catch (\Throwable | ContainerExceptionInterface $se) {
85
+        }
86
+        catch (\Throwable | ContainerExceptionInterface $se)
87
+        {
84 88
             // no need to notify when unable to register an exception
85 89
         }
86 90
     }
Please login to merge, or discard this patch.
src/GRPC/GRPCDispatcher.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
         EnvironmentInterface $env,
39 39
         FinalizerInterface $finalizer,
40 40
         ContainerInterface $container
41
-    ) {
41
+    ){
42 42
         $this->env = $env;
43 43
         $this->finalizer = $finalizer;
44 44
         $this->container = $container;
@@ -66,12 +66,12 @@  discard block
 block discarded – undo
66 66
         $worker = $this->container->get(Worker::class);
67 67
         $locator = $this->container->get(LocatorInterface::class);
68 68
 
69
-        foreach ($locator->getServices() as $interface => $service) {
69
+        foreach ($locator->getServices() as $interface => $service){
70 70
             $server->registerService($interface, $service);
71 71
         }
72 72
 
73 73
         $server->serve($worker, function (\Throwable $e = null): void {
74
-            if ($e !== null) {
74
+            if ($e !== null){
75 75
                 $this->handleException($e);
76 76
             }
77 77
 
@@ -84,9 +84,9 @@  discard block
 block discarded – undo
84 84
      */
85 85
     protected function handleException(\Throwable $e): void
86 86
     {
87
-        try {
87
+        try{
88 88
             $this->container->get(SnapshotterInterface::class)->register($e);
89
-        } catch (\Throwable | ContainerExceptionInterface $se) {
89
+        }catch (\Throwable | ContainerExceptionInterface $se){
90 90
             // no need to notify when unable to register an exception
91 91
         }
92 92
     }
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -66,12 +66,14 @@  discard block
 block discarded – undo
66 66
         $worker = $this->container->get(Worker::class);
67 67
         $locator = $this->container->get(LocatorInterface::class);
68 68
 
69
-        foreach ($locator->getServices() as $interface => $service) {
69
+        foreach ($locator->getServices() as $interface => $service)
70
+        {
70 71
             $server->registerService($interface, $service);
71 72
         }
72 73
 
73 74
         $server->serve($worker, function (\Throwable $e = null): void {
74
-            if ($e !== null) {
75
+            if ($e !== null)
76
+            {
75 77
                 $this->handleException($e);
76 78
             }
77 79
 
@@ -84,9 +86,12 @@  discard block
 block discarded – undo
84 86
      */
85 87
     protected function handleException(\Throwable $e): void
86 88
     {
87
-        try {
89
+        try
90
+        {
88 91
             $this->container->get(SnapshotterInterface::class)->register($e);
89
-        } catch (\Throwable | ContainerExceptionInterface $se) {
92
+        }
93
+        catch (\Throwable | ContainerExceptionInterface $se)
94
+        {
90 95
             // no need to notify when unable to register an exception
91 96
         }
92 97
     }
Please login to merge, or discard this patch.
tests/Framework/SnapshotTest.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,9 @@
 block discarded – undo
20 20
     {
21 21
         $app = $this->makeApp();
22 22
 
23
-        try {
23
+        try{
24 24
             throw new \Error('test error');
25
-        } catch (\Error $e) {
25
+        }catch (\Error $e){
26 26
             /** @var SnapshotInterface $s */
27 27
             $s = $app->get(SnapshotterInterface::class)->register($e);
28 28
         }
Please login to merge, or discard this patch.
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,9 +20,12 @@
 block discarded – undo
20 20
     {
21 21
         $app = $this->makeApp();
22 22
 
23
-        try {
23
+        try
24
+        {
24 25
             throw new \Error('test error');
25
-        } catch (\Error $e) {
26
+        }
27
+        catch (\Error $e)
28
+        {
26 29
             /** @var SnapshotInterface $s */
27 30
             $s = $app->get(SnapshotterInterface::class)->register($e);
28 31
         }
Please login to merge, or discard this patch.
tests/Framework/I18n/ExportTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 {
17 17
     public function testReset(): void
18 18
     {
19
-        $this->assertFileNotExists(__DIR__ . '/messages.ru.php');
19
+        $this->assertFileNotExists(__DIR__.'/messages.ru.php');
20 20
 
21 21
         $this->runCommandDebug('i18n:index');
22 22
         $this->runCommandDebug('configure');
@@ -26,9 +26,9 @@  discard block
 block discarded – undo
26 26
             '--fallback' => 'en',
27 27
         ]);
28 28
 
29
-        $this->assertFileExists(__DIR__ . '/messages.ru.php');
29
+        $this->assertFileExists(__DIR__.'/messages.ru.php');
30 30
 
31
-        $exp = (require __DIR__ . '/messages.ru.php');
31
+        $exp = (require __DIR__.'/messages.ru.php');
32 32
 
33 33
         $this->assertArrayHasKey('World', $exp);
34 34
         $this->assertSame('Мир', $exp['World']);
@@ -36,6 +36,6 @@  discard block
 block discarded – undo
36 36
         $this->assertArrayHasKey('%s unit|%s units', $exp);
37 37
         $this->assertArrayHasKey('This value is required.', $exp);
38 38
 
39
-        unlink(__DIR__ . '/messages.ru.php');
39
+        unlink(__DIR__.'/messages.ru.php');
40 40
     }
41 41
 }
Please login to merge, or discard this patch.