Passed
Push — master ( c2770c...1d5b12 )
by Anton
04:44 queued 02:18
created
src/Command/Cycle/Generator/ShowChanges.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -42,11 +42,11 @@  discard block
 block discarded – undo
42 42
         $this->output->writeln('<info>Detecting schema changes:</info>');
43 43
 
44 44
         $this->changes = [];
45
-        foreach ($registry->getIterator() as $e) {
46
-            if ($registry->hasTable($e)) {
45
+        foreach ($registry->getIterator() as $e){
46
+            if ($registry->hasTable($e)){
47 47
                 $table = $registry->getTableSchema($e);
48 48
 
49
-                if ($table->getComparator()->hasChanges()) {
49
+                if ($table->getComparator()->hasChanges()){
50 50
                     $this->changes[] = [
51 51
                         'database' => $registry->getDatabase($e),
52 52
                         'table'    => $registry->getTable($e),
@@ -56,13 +56,13 @@  discard block
 block discarded – undo
56 56
             }
57 57
         }
58 58
 
59
-        if ($this->changes === []) {
59
+        if ($this->changes === []){
60 60
             $this->output->writeln('<fg=yellow>no database changes has been detected</fg=yellow>');
61 61
 
62 62
             return $registry;
63 63
         }
64 64
 
65
-        foreach ($this->changes as $change) {
65
+        foreach ($this->changes as $change){
66 66
             $this->output->write(sprintf('• <fg=cyan>%s.%s</fg=cyan>', $change['database'], $change['table']));
67 67
             $this->describeChanges($change['schema']);
68 68
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
      */
84 84
     protected function describeChanges(AbstractTable $table): void
85 85
     {
86
-        if (!$this->output->isVerbose()) {
86
+        if (!$this->output->isVerbose()){
87 87
             $this->output->writeln(
88 88
                 sprintf(
89 89
                     ': <fg=green>%s</fg=green> change(s) detected',
@@ -96,11 +96,11 @@  discard block
 block discarded – undo
96 96
         $this->output->write("\n");
97 97
 
98 98
 
99
-        if (!$table->exists()) {
99
+        if (!$table->exists()){
100 100
             $this->output->writeln('    - create table');
101 101
         }
102 102
 
103
-        if ($table->getStatus() === AbstractTable::STATUS_DECLARED_DROPPED) {
103
+        if ($table->getStatus() === AbstractTable::STATUS_DECLARED_DROPPED){
104 104
             $this->output->writeln('    - drop table');
105 105
             return;
106 106
         }
@@ -117,15 +117,15 @@  discard block
 block discarded – undo
117 117
      */
118 118
     protected function describeColumns(Comparator $cmp): void
119 119
     {
120
-        foreach ($cmp->addedColumns() as $column) {
120
+        foreach ($cmp->addedColumns() as $column){
121 121
             $this->output->writeln("    - add column <fg=yellow>{$column->getName()}</fg=yellow>");
122 122
         }
123 123
 
124
-        foreach ($cmp->droppedColumns() as $column) {
124
+        foreach ($cmp->droppedColumns() as $column){
125 125
             $this->output->writeln("    - drop column <fg=yellow>{$column->getName()}</fg=yellow>");
126 126
         }
127 127
 
128
-        foreach ($cmp->alteredColumns() as $column) {
128
+        foreach ($cmp->alteredColumns() as $column){
129 129
             $column = $column[0];
130 130
             $this->output->writeln("    - alter column <fg=yellow>{$column->getName()}</fg=yellow>");
131 131
         }
@@ -136,17 +136,17 @@  discard block
 block discarded – undo
136 136
      */
137 137
     protected function describeIndexes(Comparator $cmp): void
138 138
     {
139
-        foreach ($cmp->addedIndexes() as $index) {
139
+        foreach ($cmp->addedIndexes() as $index){
140 140
             $index = join(', ', $index->getColumns());
141 141
             $this->output->writeln("    - add index on <fg=yellow>[{$index}]</fg=yellow>");
142 142
         }
143 143
 
144
-        foreach ($cmp->droppedIndexes() as $index) {
144
+        foreach ($cmp->droppedIndexes() as $index){
145 145
             $index = join(', ', $index->getColumns());
146 146
             $this->output->writeln("    - drop index on <fg=yellow>[{$index}]</fg=yellow>");
147 147
         }
148 148
 
149
-        foreach ($cmp->alteredIndexes() as $index) {
149
+        foreach ($cmp->alteredIndexes() as $index){
150 150
             $index = $index[0];
151 151
             $index = join(', ', $index->getColumns());
152 152
             $this->output->writeln("    - alter index on <fg=yellow>[{$index}]</fg=yellow>");
@@ -158,17 +158,17 @@  discard block
 block discarded – undo
158 158
      */
159 159
     protected function describeFKs(Comparator $cmp): void
160 160
     {
161
-        foreach ($cmp->addedForeignKeys() as $fk) {
161
+        foreach ($cmp->addedForeignKeys() as $fk){
162 162
             $fkColumns = join(', ', $fk->getColumns());
163 163
             $this->output->writeln("    - add foreign key on <fg=yellow>{$fkColumns}</fg=yellow>");
164 164
         }
165 165
 
166
-        foreach ($cmp->droppedForeignKeys() as $fk) {
166
+        foreach ($cmp->droppedForeignKeys() as $fk){
167 167
             $fkColumns = join(', ', $fk->getColumns());
168 168
             $this->output->writeln("    - drop foreign key <fg=yellow>{$fkColumns}</fg=yellow>");
169 169
         }
170 170
 
171
-        foreach ($cmp->alteredForeignKeys() as $fk) {
171
+        foreach ($cmp->alteredForeignKeys() as $fk){
172 172
             $fk = $fk[0];
173 173
             $fkColumns = join(', ', $fk->getColumns());
174 174
             $this->output->writeln("    - alter foreign key <fg=yellow>{$fkColumns}</fg=yellow>");
Please login to merge, or discard this patch.
Braces   +34 added lines, -17 removed lines patch added patch discarded remove patch
@@ -42,11 +42,14 @@  discard block
 block discarded – undo
42 42
         $this->output->writeln('<info>Detecting schema changes:</info>');
43 43
 
44 44
         $this->changes = [];
45
-        foreach ($registry->getIterator() as $e) {
46
-            if ($registry->hasTable($e)) {
45
+        foreach ($registry->getIterator() as $e)
46
+        {
47
+            if ($registry->hasTable($e))
48
+            {
47 49
                 $table = $registry->getTableSchema($e);
48 50
 
49
-                if ($table->getComparator()->hasChanges()) {
51
+                if ($table->getComparator()->hasChanges())
52
+                {
50 53
                     $this->changes[] = [
51 54
                         'database' => $registry->getDatabase($e),
52 55
                         'table'    => $registry->getTable($e),
@@ -56,13 +59,15 @@  discard block
 block discarded – undo
56 59
             }
57 60
         }
58 61
 
59
-        if ($this->changes === []) {
62
+        if ($this->changes === [])
63
+        {
60 64
             $this->output->writeln('<fg=yellow>no database changes has been detected</fg=yellow>');
61 65
 
62 66
             return $registry;
63 67
         }
64 68
 
65
-        foreach ($this->changes as $change) {
69
+        foreach ($this->changes as $change)
70
+        {
66 71
             $this->output->write(sprintf('• <fg=cyan>%s.%s</fg=cyan>', $change['database'], $change['table']));
67 72
             $this->describeChanges($change['schema']);
68 73
         }
@@ -83,7 +88,8 @@  discard block
 block discarded – undo
83 88
      */
84 89
     protected function describeChanges(AbstractTable $table): void
85 90
     {
86
-        if (!$this->output->isVerbose()) {
91
+        if (!$this->output->isVerbose())
92
+        {
87 93
             $this->output->writeln(
88 94
                 sprintf(
89 95
                     ': <fg=green>%s</fg=green> change(s) detected',
@@ -96,11 +102,13 @@  discard block
 block discarded – undo
96 102
         $this->output->write("\n");
97 103
 
98 104
 
99
-        if (!$table->exists()) {
105
+        if (!$table->exists())
106
+        {
100 107
             $this->output->writeln('    - create table');
101 108
         }
102 109
 
103
-        if ($table->getStatus() === AbstractTable::STATUS_DECLARED_DROPPED) {
110
+        if ($table->getStatus() === AbstractTable::STATUS_DECLARED_DROPPED)
111
+        {
104 112
             $this->output->writeln('    - drop table');
105 113
             return;
106 114
         }
@@ -117,15 +125,18 @@  discard block
 block discarded – undo
117 125
      */
118 126
     protected function describeColumns(Comparator $cmp): void
119 127
     {
120
-        foreach ($cmp->addedColumns() as $column) {
128
+        foreach ($cmp->addedColumns() as $column)
129
+        {
121 130
             $this->output->writeln("    - add column <fg=yellow>{$column->getName()}</fg=yellow>");
122 131
         }
123 132
 
124
-        foreach ($cmp->droppedColumns() as $column) {
133
+        foreach ($cmp->droppedColumns() as $column)
134
+        {
125 135
             $this->output->writeln("    - drop column <fg=yellow>{$column->getName()}</fg=yellow>");
126 136
         }
127 137
 
128
-        foreach ($cmp->alteredColumns() as $column) {
138
+        foreach ($cmp->alteredColumns() as $column)
139
+        {
129 140
             $column = $column[0];
130 141
             $this->output->writeln("    - alter column <fg=yellow>{$column->getName()}</fg=yellow>");
131 142
         }
@@ -136,17 +147,20 @@  discard block
 block discarded – undo
136 147
      */
137 148
     protected function describeIndexes(Comparator $cmp): void
138 149
     {
139
-        foreach ($cmp->addedIndexes() as $index) {
150
+        foreach ($cmp->addedIndexes() as $index)
151
+        {
140 152
             $index = join(', ', $index->getColumns());
141 153
             $this->output->writeln("    - add index on <fg=yellow>[{$index}]</fg=yellow>");
142 154
         }
143 155
 
144
-        foreach ($cmp->droppedIndexes() as $index) {
156
+        foreach ($cmp->droppedIndexes() as $index)
157
+        {
145 158
             $index = join(', ', $index->getColumns());
146 159
             $this->output->writeln("    - drop index on <fg=yellow>[{$index}]</fg=yellow>");
147 160
         }
148 161
 
149
-        foreach ($cmp->alteredIndexes() as $index) {
162
+        foreach ($cmp->alteredIndexes() as $index)
163
+        {
150 164
             $index = $index[0];
151 165
             $index = join(', ', $index->getColumns());
152 166
             $this->output->writeln("    - alter index on <fg=yellow>[{$index}]</fg=yellow>");
@@ -158,17 +172,20 @@  discard block
 block discarded – undo
158 172
      */
159 173
     protected function describeFKs(Comparator $cmp): void
160 174
     {
161
-        foreach ($cmp->addedForeignKeys() as $fk) {
175
+        foreach ($cmp->addedForeignKeys() as $fk)
176
+        {
162 177
             $fkColumns = join(', ', $fk->getColumns());
163 178
             $this->output->writeln("    - add foreign key on <fg=yellow>{$fkColumns}</fg=yellow>");
164 179
         }
165 180
 
166
-        foreach ($cmp->droppedForeignKeys() as $fk) {
181
+        foreach ($cmp->droppedForeignKeys() as $fk)
182
+        {
167 183
             $fkColumns = join(', ', $fk->getColumns());
168 184
             $this->output->writeln("    - drop foreign key <fg=yellow>{$fkColumns}</fg=yellow>");
169 185
         }
170 186
 
171
-        foreach ($cmp->alteredForeignKeys() as $fk) {
187
+        foreach ($cmp->alteredForeignKeys() as $fk)
188
+        {
172 189
             $fk = $fk[0];
173 190
             $fkColumns = join(', ', $fk->getColumns());
174 191
             $this->output->writeln("    - alter foreign key <fg=yellow>{$fkColumns}</fg=yellow>");
Please login to merge, or discard this patch.
src/Command/Migrate/StatusCommand.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -28,18 +28,18 @@  discard block
 block discarded – undo
28 28
      */
29 29
     public function perform(FilesInterface $files): void
30 30
     {
31
-        if (!$this->verifyConfigured()) {
31
+        if (!$this->verifyConfigured()){
32 32
             return;
33 33
         }
34 34
 
35
-        if (empty($this->migrator->getMigrations())) {
35
+        if (empty($this->migrator->getMigrations())){
36 36
             $this->writeln('<comment>No migrations were found.</comment>');
37 37
 
38 38
             return;
39 39
         }
40 40
 
41 41
         $table = $this->table(['Migration', 'Created at', 'Executed at']);
42
-        foreach ($this->migrator->getMigrations() as $migration) {
42
+        foreach ($this->migrator->getMigrations() as $migration){
43 43
             $state = $migration->getState();
44 44
 
45 45
             $table->addRow(
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
                     $state->getTimeCreated()->format('Y-m-d H:i:s'),
49 49
                     $state->getStatus() == State::STATUS_PENDING
50 50
                         ? self::PENDING
51
-                        : '<info>' . $state->getTimeExecuted()->format('Y-m-d H:i:s') . '</info>'
51
+                        : '<info>'.$state->getTimeExecuted()->format('Y-m-d H:i:s').'</info>'
52 52
                 ]
53 53
             );
54 54
         }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,18 +28,21 @@
 block discarded – undo
28 28
      */
29 29
     public function perform(FilesInterface $files): void
30 30
     {
31
-        if (!$this->verifyConfigured()) {
31
+        if (!$this->verifyConfigured())
32
+        {
32 33
             return;
33 34
         }
34 35
 
35
-        if (empty($this->migrator->getMigrations())) {
36
+        if (empty($this->migrator->getMigrations()))
37
+        {
36 38
             $this->writeln('<comment>No migrations were found.</comment>');
37 39
 
38 40
             return;
39 41
         }
40 42
 
41 43
         $table = $this->table(['Migration', 'Created at', 'Executed at']);
42
-        foreach ($this->migrator->getMigrations() as $migration) {
44
+        foreach ($this->migrator->getMigrations() as $migration)
45
+        {
43 46
             $state = $migration->getState();
44 47
 
45 48
             $table->addRow(
Please login to merge, or discard this patch.
src/Command/GRPC/ListCommand.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $services = $locator->getServices();
28 28
 
29
-        if ($services === []) {
29
+        if ($services === []){
30 30
             $this->writeln('<comment>No GRPC services were found.</comment>');
31 31
             return;
32 32
         }
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             ]
40 40
         );
41 41
 
42
-        foreach ($services as $interface => $instance) {
42
+        foreach ($services as $interface => $instance){
43 43
             $grid->addRow(
44 44
                 [
45 45
                     $interface::NAME,
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,8 @@  discard block
 block discarded – undo
26 26
     {
27 27
         $services = $locator->getServices();
28 28
 
29
-        if ($services === []) {
29
+        if ($services === [])
30
+        {
30 31
             $this->writeln('<comment>No GRPC services were found.</comment>');
31 32
             return;
32 33
         }
@@ -39,7 +40,8 @@  discard block
 block discarded – undo
39 40
             ]
40 41
         );
41 42
 
42
-        foreach ($services as $interface => $instance) {
43
+        foreach ($services as $interface => $instance)
44
+        {
43 45
             $grid->addRow(
44 46
                 [
45 47
                     $interface::NAME,
Please login to merge, or discard this patch.
src/Domain/GuardInterceptor.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $permission = $this->getPermissions($controller, $action);
54 54
 
55
-        if ($permission !== null && !$this->guard->allows($permission[0], $parameters)) {
55
+        if ($permission !== null && !$this->guard->allows($permission[0], $parameters)){
56 56
             throw new ControllerException(
57 57
                 sprintf(
58 58
                     'Unauthorized permission `%s` for action `%s`->`%s`',
@@ -79,14 +79,14 @@  discard block
 block discarded – undo
79 79
     private function getPermissions(string $controller, string $action): ?array
80 80
     {
81 81
         $key = sprintf('%s:%s', $controller, $action);
82
-        if (array_key_exists($key, $this->cache)) {
82
+        if (array_key_exists($key, $this->cache)){
83 83
             return $this->cache[$key];
84 84
         }
85 85
 
86 86
         $this->cache[$key] = null;
87
-        try {
87
+        try{
88 88
             $method = new \ReflectionMethod($controller, $action);
89
-        } catch (\ReflectionException $e) {
89
+        }catch (\ReflectionException $e){
90 90
             return null;
91 91
         }
92 92
 
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             Guarded::class
105 105
         );
106 106
 
107
-        if ($action === null) {
107
+        if ($action === null){
108 108
             return null;
109 109
         }
110 110
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             ControllerException::FORBIDDEN
127 127
         ];
128 128
 
129
-        if ($guarded->permission === null && $ns === null) {
129
+        if ($guarded->permission === null && $ns === null){
130 130
             throw new InterceptorException(
131 131
                 sprintf(
132 132
                     'Unable to apply @Guarded without name or @GuardNamespace on `%s`->`%s`',
@@ -136,16 +136,16 @@  discard block
 block discarded – undo
136 136
             );
137 137
         }
138 138
 
139
-        if ($ns !== null) {
139
+        if ($ns !== null){
140 140
             $permission[0] = sprintf('%s.%s', $ns->namespace, $permission[0]);
141 141
         }
142 142
 
143
-        if ($this->namespace !== null) {
143
+        if ($this->namespace !== null){
144 144
             // global namespace
145 145
             $permission[0] = sprintf('%s.%s', $this->namespace, $permission[0]);
146 146
         }
147 147
 
148
-        switch ($guarded->else) {
148
+        switch ($guarded->else){
149 149
             case 'badAction':
150 150
                 $permission[1] = ControllerException::BAD_ACTION;
151 151
                 break;
Please login to merge, or discard this patch.
Braces   +19 added lines, -9 removed lines patch added patch discarded remove patch
@@ -52,7 +52,8 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $permission = $this->getPermissions($controller, $action);
54 54
 
55
-        if ($permission !== null && !$this->guard->allows($permission[0], $parameters)) {
55
+        if ($permission !== null && !$this->guard->allows($permission[0], $parameters))
56
+        {
56 57
             throw new ControllerException(
57 58
                 sprintf(
58 59
                     'Unauthorized permission `%s` for action `%s`->`%s`',
@@ -79,14 +80,18 @@  discard block
 block discarded – undo
79 80
     private function getPermissions(string $controller, string $action): ?array
80 81
     {
81 82
         $key = sprintf('%s:%s', $controller, $action);
82
-        if (array_key_exists($key, $this->cache)) {
83
+        if (array_key_exists($key, $this->cache))
84
+        {
83 85
             return $this->cache[$key];
84 86
         }
85 87
 
86 88
         $this->cache[$key] = null;
87
-        try {
89
+        try
90
+        {
88 91
             $method = new \ReflectionMethod($controller, $action);
89
-        } catch (\ReflectionException $e) {
92
+        }
93
+        catch (\ReflectionException $e)
94
+        {
90 95
             return null;
91 96
         }
92 97
 
@@ -104,7 +109,8 @@  discard block
 block discarded – undo
104 109
             Guarded::class
105 110
         );
106 111
 
107
-        if ($action === null) {
112
+        if ($action === null)
113
+        {
108 114
             return null;
109 115
         }
110 116
 
@@ -126,7 +132,8 @@  discard block
 block discarded – undo
126 132
             ControllerException::FORBIDDEN
127 133
         ];
128 134
 
129
-        if ($guarded->permission === null && $ns === null) {
135
+        if ($guarded->permission === null && $ns === null)
136
+        {
130 137
             throw new InterceptorException(
131 138
                 sprintf(
132 139
                     'Unable to apply @Guarded without name or @GuardNamespace on `%s`->`%s`',
@@ -136,16 +143,19 @@  discard block
 block discarded – undo
136 143
             );
137 144
         }
138 145
 
139
-        if ($ns !== null) {
146
+        if ($ns !== null)
147
+        {
140 148
             $permission[0] = sprintf('%s.%s', $ns->namespace, $permission[0]);
141 149
         }
142 150
 
143
-        if ($this->namespace !== null) {
151
+        if ($this->namespace !== null)
152
+        {
144 153
             // global namespace
145 154
             $permission[0] = sprintf('%s.%s', $this->namespace, $permission[0]);
146 155
         }
147 156
 
148
-        switch ($guarded->else) {
157
+        switch ($guarded->else)
158
+        {
149 159
             case 'badAction':
150 160
                 $permission[1] = ControllerException::BAD_ACTION;
151 161
                 break;
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
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
         EnvironmentInterface $env,
40 40
         FinalizerInterface $finalizer,
41 41
         ContainerInterface $container
42
-    ) {
42
+    ){
43 43
         $this->env = $env;
44 44
         $this->finalizer = $finalizer;
45 45
         $this->container = $container;
@@ -69,14 +69,14 @@  discard block
 block discarded – undo
69 69
         $worker = $this->container->get(Worker::class);
70 70
         $locator = $this->container->get(LocatorInterface::class);
71 71
 
72
-        foreach ($locator->getServices() as $interface => $service) {
72
+        foreach ($locator->getServices() as $interface => $service){
73 73
             $server->registerService($interface, $service);
74 74
         }
75 75
 
76 76
         $server->serve(
77 77
             $worker,
78 78
             function (\Throwable $e = null): void {
79
-                if ($e !== null) {
79
+                if ($e !== null){
80 80
                     $this->handleException($e);
81 81
                 }
82 82
 
@@ -90,9 +90,9 @@  discard block
 block discarded – undo
90 90
      */
91 91
     protected function handleException(\Throwable $e): void
92 92
     {
93
-        try {
93
+        try{
94 94
             $this->container->get(SnapshotterInterface::class)->register($e);
95
-        } catch (\Throwable | ContainerExceptionInterface $se) {
95
+        }catch (\Throwable | ContainerExceptionInterface $se){
96 96
             // no need to notify when unable to register an exception
97 97
         }
98 98
     }
Please login to merge, or discard this patch.
Braces   +9 added lines, -4 removed lines patch added patch discarded remove patch
@@ -69,14 +69,16 @@  discard block
 block discarded – undo
69 69
         $worker = $this->container->get(Worker::class);
70 70
         $locator = $this->container->get(LocatorInterface::class);
71 71
 
72
-        foreach ($locator->getServices() as $interface => $service) {
72
+        foreach ($locator->getServices() as $interface => $service)
73
+        {
73 74
             $server->registerService($interface, $service);
74 75
         }
75 76
 
76 77
         $server->serve(
77 78
             $worker,
78 79
             function (\Throwable $e = null): void {
79
-                if ($e !== null) {
80
+                if ($e !== null)
81
+                {
80 82
                     $this->handleException($e);
81 83
                 }
82 84
 
@@ -90,9 +92,12 @@  discard block
 block discarded – undo
90 92
      */
91 93
     protected function handleException(\Throwable $e): void
92 94
     {
93
-        try {
95
+        try
96
+        {
94 97
             $this->container->get(SnapshotterInterface::class)->register($e);
95
-        } catch (\Throwable | ContainerExceptionInterface $se) {
98
+        }
99
+        catch (\Throwable | ContainerExceptionInterface $se)
100
+        {
96 101
             // no need to notify when unable to register an exception
97 102
         }
98 103
     }
Please login to merge, or discard this patch.
src/GRPC/ProtoCompiler.php 2 patches
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -63,14 +63,14 @@  discard block
 block discarded – undo
63 63
 
64 64
         $output = trim(join("\n", $output), "\n ,");
65 65
 
66
-        if ($output !== '') {
66
+        if ($output !== ''){
67 67
             $this->files->deleteDirectory($tmpDir);
68 68
             throw new CompileException($output);
69 69
         }
70 70
 
71 71
         // copying files (using relative path and namespace)
72 72
         $result = [];
73
-        foreach ($this->files->getFiles($tmpDir) as $file) {
73
+        foreach ($this->files->getFiles($tmpDir) as $file){
74 74
             $result[] = $this->copy($tmpDir, $file);
75 75
         }
76 76
 
@@ -87,11 +87,11 @@  discard block
 block discarded – undo
87 87
     private function copy(string $tmpDir, string $file): string
88 88
     {
89 89
         $source = ltrim($this->files->relativePath($file, $tmpDir), '\\/');
90
-        if (strpos($source, $this->baseNamespace) === 0) {
90
+        if (strpos($source, $this->baseNamespace) === 0){
91 91
             $source = ltrim(substr($source, strlen($this->baseNamespace)), '\\/');
92 92
         }
93 93
 
94
-        $target = $this->files->normalizePath($this->basePath . '/' . $source);
94
+        $target = $this->files->normalizePath($this->basePath.'/'.$source);
95 95
 
96 96
         $this->files->ensureDirectory(dirname($target));
97 97
         $this->files->copy($file, $target);
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
      */
105 105
     private function tmpDir(): string
106 106
     {
107
-        $directory = sys_get_temp_dir() . '/' . spl_object_hash($this);
107
+        $directory = sys_get_temp_dir().'/'.spl_object_hash($this);
108 108
         $this->files->ensureDirectory($directory);
109 109
 
110 110
         return $this->files->normalizePath($directory, true);
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
     {
121 121
         return array_filter(
122 122
             $this->files->getFiles(dirname($protoFile)),
123
-            function ($file) {
123
+            function ($file){
124 124
                 return strpos($file, '.proto') !== false;
125 125
             }
126 126
         );
Please login to merge, or discard this patch.
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -63,14 +63,16 @@  discard block
 block discarded – undo
63 63
 
64 64
         $output = trim(join("\n", $output), "\n ,");
65 65
 
66
-        if ($output !== '') {
66
+        if ($output !== '')
67
+        {
67 68
             $this->files->deleteDirectory($tmpDir);
68 69
             throw new CompileException($output);
69 70
         }
70 71
 
71 72
         // copying files (using relative path and namespace)
72 73
         $result = [];
73
-        foreach ($this->files->getFiles($tmpDir) as $file) {
74
+        foreach ($this->files->getFiles($tmpDir) as $file)
75
+        {
74 76
             $result[] = $this->copy($tmpDir, $file);
75 77
         }
76 78
 
@@ -87,7 +89,8 @@  discard block
 block discarded – undo
87 89
     private function copy(string $tmpDir, string $file): string
88 90
     {
89 91
         $source = ltrim($this->files->relativePath($file, $tmpDir), '\\/');
90
-        if (strpos($source, $this->baseNamespace) === 0) {
92
+        if (strpos($source, $this->baseNamespace) === 0)
93
+        {
91 94
             $source = ltrim(substr($source, strlen($this->baseNamespace)), '\\/');
92 95
         }
93 96
 
@@ -120,7 +123,8 @@  discard block
 block discarded – undo
120 123
     {
121 124
         return array_filter(
122 125
             $this->files->getFiles(dirname($protoFile)),
123
-            function ($file) {
126
+            function ($file)
127
+            {
124 128
                 return strpos($file, '.proto') !== false;
125 129
             }
126 130
         );
Please login to merge, or discard this patch.
src/Command/Router/DebugCommand.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,8 +23,8 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $grid = $this->table(['Verbs:', 'Pattern:', 'Target:']);
25 25
 
26
-        foreach ($this->getRoutes($router) as $name => $route) {
27
-            if ($route instanceof Route) {
26
+        foreach ($this->getRoutes($router) as $name => $route){
27
+            if ($route instanceof Route){
28 28
                 $this->renderRoute($grid, $name, $route);
29 29
             }
30 30
         }
@@ -65,8 +65,8 @@  discard block
 block discarded – undo
65 65
     {
66 66
         $result = [];
67 67
 
68
-        foreach ($route->getVerbs() as $verb) {
69
-            switch (strtolower($verb)) {
68
+        foreach ($route->getVerbs() as $verb){
69
+            switch (strtolower($verb)){
70 70
                 case 'get':
71 71
                     $verb = '<fg=green>GET</>';
72 72
                     break;
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 
103 103
         return preg_replace_callback(
104 104
             '/<([^>]*)>/',
105
-            static function ($m) {
105
+            static function ($m){
106 106
                 return sprintf('<fg=yellow>%s</>', $m[0]);
107 107
             },
108 108
             $pattern
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
     private function getTarget(Route $route): string
117 117
     {
118 118
         $target = $this->getValue($route, 'target');
119
-        switch (true) {
119
+        switch (true){
120 120
             case $target instanceof Action:
121 121
                 return sprintf(
122 122
                     '%s::%s',
@@ -136,11 +136,11 @@  discard block
 block discarded – undo
136 136
      */
137 137
     private function getValue(object $object, string $property)
138 138
     {
139
-        try {
139
+        try{
140 140
             $r = new \ReflectionObject($object);
141 141
             $prop = $r->getProperty($property);
142 142
             $prop->setAccessible(true);
143
-        } catch (\Throwable $e) {
143
+        }catch (\Throwable $e){
144 144
             return $e->getMessage();
145 145
         }
146 146
 
Please login to merge, or discard this patch.
Braces   +17 added lines, -8 removed lines patch added patch discarded remove patch
@@ -23,8 +23,10 @@  discard block
 block discarded – undo
23 23
     {
24 24
         $grid = $this->table(['Verbs:', 'Pattern:', 'Target:']);
25 25
 
26
-        foreach ($this->getRoutes($router) as $name => $route) {
27
-            if ($route instanceof Route) {
26
+        foreach ($this->getRoutes($router) as $name => $route)
27
+        {
28
+            if ($route instanceof Route)
29
+            {
28 30
                 $this->renderRoute($grid, $name, $route);
29 31
             }
30 32
         }
@@ -65,8 +67,10 @@  discard block
 block discarded – undo
65 67
     {
66 68
         $result = [];
67 69
 
68
-        foreach ($route->getVerbs() as $verb) {
69
-            switch (strtolower($verb)) {
70
+        foreach ($route->getVerbs() as $verb)
71
+        {
72
+            switch (strtolower($verb))
73
+            {
70 74
                 case 'get':
71 75
                     $verb = '<fg=green>GET</>';
72 76
                     break;
@@ -102,7 +106,8 @@  discard block
 block discarded – undo
102 106
 
103 107
         return preg_replace_callback(
104 108
             '/<([^>]*)>/',
105
-            static function ($m) {
109
+            static function ($m)
110
+            {
106 111
                 return sprintf('<fg=yellow>%s</>', $m[0]);
107 112
             },
108 113
             $pattern
@@ -116,7 +121,8 @@  discard block
 block discarded – undo
116 121
     private function getTarget(Route $route): string
117 122
     {
118 123
         $target = $this->getValue($route, 'target');
119
-        switch (true) {
124
+        switch (true)
125
+        {
120 126
             case $target instanceof Action:
121 127
                 return sprintf(
122 128
                     '%s::%s',
@@ -136,11 +142,14 @@  discard block
 block discarded – undo
136 142
      */
137 143
     private function getValue(object $object, string $property)
138 144
     {
139
-        try {
145
+        try
146
+        {
140 147
             $r = new \ReflectionObject($object);
141 148
             $prop = $r->getProperty($property);
142 149
             $prop->setAccessible(true);
143
-        } catch (\Throwable $e) {
150
+        }
151
+        catch (\Throwable $e)
152
+        {
144 153
             return $e->getMessage();
145 154
         }
146 155
 
Please login to merge, or discard this patch.