Passed
Pull Request — master (#298)
by Valentin
04:51
created
tests/Framework/Cycle/SchemaTest.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,10 +62,10 @@
 block discarded – undo
62 62
     {
63 63
         $app = TestApp::init(
64 64
             [
65
-                'root'    => __DIR__ . '/../../..',
66
-                'app'     => __DIR__ . '/../../emptyApp',
67
-                'runtime' => sys_get_temp_dir() . '/spiral',
68
-                'cache'   => sys_get_temp_dir() . '/spiral',
65
+                'root'    => __DIR__.'/../../..',
66
+                'app'     => __DIR__.'/../../emptyApp',
67
+                'runtime' => sys_get_temp_dir().'/spiral',
68
+                'cache'   => sys_get_temp_dir().'/spiral',
69 69
             ],
70 70
             new Environment(['SAFE_MIGRATIONS' => true]),
71 71
             false
Please login to merge, or discard this patch.
src/Framework/Bootloader/Cycle/SchemaBootloader.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,11 +85,11 @@  discard block
 block discarded – undo
85 85
     public function getGenerators(): array
86 86
     {
87 87
         $result = [];
88
-        foreach ($this->generators as $group) {
89
-            foreach ($group as $generator) {
90
-                if (is_object($generator) && !$generator instanceof Container\Autowire) {
88
+        foreach ($this->generators as $group){
89
+            foreach ($group as $generator){
90
+                if (is_object($generator) && !$generator instanceof Container\Autowire){
91 91
                     $result[] = $generator;
92
-                } else {
92
+                }else{
93 93
                     $result[] = $this->container->get($generator);
94 94
                 }
95 95
             }
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     protected function schema(MemoryInterface $memory): SchemaInterface
108 108
     {
109 109
         $schemaCompiler = SchemaCompiler::fromMemory($memory);
110
-        if ($schemaCompiler->isEmpty()) {
110
+        if ($schemaCompiler->isEmpty()){
111 111
             $schemaCompiler = SchemaCompiler::compile(
112 112
                 $this->container->get(Registry::class),
113 113
                 $this->getGenerators()
Please login to merge, or discard this patch.
Braces   +11 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,11 +85,16 @@  discard block
 block discarded – undo
85 85
     public function getGenerators(): array
86 86
     {
87 87
         $result = [];
88
-        foreach ($this->generators as $group) {
89
-            foreach ($group as $generator) {
90
-                if (is_object($generator) && !$generator instanceof Container\Autowire) {
88
+        foreach ($this->generators as $group)
89
+        {
90
+            foreach ($group as $generator)
91
+            {
92
+                if (is_object($generator) && !$generator instanceof Container\Autowire)
93
+                {
91 94
                     $result[] = $generator;
92
-                } else {
95
+                }
96
+                else
97
+                {
93 98
                     $result[] = $this->container->get($generator);
94 99
                 }
95 100
             }
@@ -107,7 +112,8 @@  discard block
 block discarded – undo
107 112
     protected function schema(MemoryInterface $memory): SchemaInterface
108 113
     {
109 114
         $schemaCompiler = SchemaCompiler::fromMemory($memory);
110
-        if ($schemaCompiler->isEmpty()) {
115
+        if ($schemaCompiler->isEmpty())
116
+        {
111 117
             $schemaCompiler = SchemaCompiler::compile(
112 118
                 $this->container->get(Registry::class),
113 119
                 $this->getGenerators()
Please login to merge, or discard this patch.
src/Framework/Command/Cycle/SyncCommand.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
         );
45 45
         $schemaCompiler->toMemory($memory);
46 46
 
47
-        if ($show->hasChanges()) {
47
+        if ($show->hasChanges()){
48 48
             $this->writeln("\n<info>ORM Schema has been synchronized</info>");
49 49
         }
50 50
     }
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,8 @@
 block discarded – undo
44 44
         );
45 45
         $schemaCompiler->toMemory($memory);
46 46
 
47
-        if ($show->hasChanges()) {
47
+        if ($show->hasChanges())
48
+        {
48 49
             $this->writeln("\n<info>ORM Schema has been synchronized</info>");
49 50
         }
50 51
     }
Please login to merge, or discard this patch.
src/Framework/Command/Cycle/MigrateCommand.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,12 +50,12 @@  discard block
 block discarded – undo
50 50
         Migrator $migrator,
51 51
         Console $console
52 52
     ): void {
53
-        if (!$this->verifyConfigured()) {
53
+        if (!$this->verifyConfigured()){
54 54
             return;
55 55
         }
56 56
 
57
-        foreach ($migrator->getMigrations() as $migration) {
58
-            if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED) {
57
+        foreach ($migrator->getMigrations() as $migration){
58
+            if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED){
59 59
                 $this->writeln('<fg=red>Outstanding migrations found, run `migrate` first.</fg=red>');
60 60
                 return;
61 61
             }
@@ -69,10 +69,10 @@  discard block
 block discarded – undo
69 69
         );
70 70
         $schemaCompiler->toMemory($memory);
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
         }
Please login to merge, or discard this patch.
Braces   +10 added lines, -5 removed lines patch added patch discarded remove patch
@@ -50,12 +50,15 @@  discard block
 block discarded – undo
50 50
         Migrator $migrator,
51 51
         Console $console
52 52
     ): void {
53
-        if (!$this->verifyConfigured()) {
53
+        if (!$this->verifyConfigured())
54
+        {
54 55
             return;
55 56
         }
56 57
 
57
-        foreach ($migrator->getMigrations() as $migration) {
58
-            if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED) {
58
+        foreach ($migrator->getMigrations() as $migration)
59
+        {
60
+            if ($migration->getState()->getStatus() !== State::STATUS_EXECUTED)
61
+            {
59 62
                 $this->writeln('<fg=red>Outstanding migrations found, run `migrate` first.</fg=red>');
60 63
                 return;
61 64
             }
@@ -69,10 +72,12 @@  discard block
 block discarded – undo
69 72
         );
70 73
         $schemaCompiler->toMemory($memory);
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
         }
Please login to merge, or discard this patch.