Passed
Push — master ( 8b6293...069289 )
by Anton
04:46 queued 02:28
created
src/Bootloader/Database/DisconnectsBootloader.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         $finalizer->addFinalizer(function () use ($container): void {
29 29
             /** @var DatabaseManager $dbal */
30 30
             $dbal = $container->get(DatabaseManager::class);
31
-            foreach ($dbal->getDrivers() as $driver) {
31
+            foreach ($dbal->getDrivers() as $driver){
32 32
                 $driver->disconnect();
33 33
             }
34 34
         });
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,8 @@
 block discarded – undo
28 28
         $finalizer->addFinalizer(function () use ($container): void {
29 29
             /** @var DatabaseManager $dbal */
30 30
             $dbal = $container->get(DatabaseManager::class);
31
-            foreach ($dbal->getDrivers() as $driver) {
31
+            foreach ($dbal->getDrivers() as $driver)
32
+            {
32 33
                 $driver->disconnect();
33 34
             }
34 35
         });
Please login to merge, or discard this patch.
src/Bootloader/Database/MigrationsBootloader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -40,8 +40,8 @@
 block discarded – undo
40 40
         EnvironmentInterface $env,
41 41
         DirectoriesInterface $dirs
42 42
     ): void {
43
-        if (!$dirs->has('migrations')) {
44
-            $dirs->set('migrations', $dirs->get('app') . 'migrations');
43
+        if (!$dirs->has('migrations')){
44
+            $dirs->set('migrations', $dirs->get('app').'migrations');
45 45
         }
46 46
 
47 47
         $config->setDefaults('migration', [
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -40,7 +40,8 @@
 block discarded – undo
40 40
         EnvironmentInterface $env,
41 41
         DirectoriesInterface $dirs
42 42
     ): void {
43
-        if (!$dirs->has('migrations')) {
43
+        if (!$dirs->has('migrations'))
44
+        {
44 45
             $dirs->set('migrations', $dirs->get('app') . 'migrations');
45 46
         }
46 47
 
Please login to merge, or discard this patch.
src/Bootloader/Http/SessionBootloader.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
             'handler'  => new Autowire(
63 63
                 FileHandler::class,
64 64
                 [
65
-                    'directory' => $directories->get('runtime') . 'session',
65
+                    'directory' => $directories->get('runtime').'session',
66 66
                     'lifetime'  => 86400
67 67
                 ]
68 68
             )
Please login to merge, or discard this patch.
src/Bootloader/I18nBootloader.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@
 block discarded – undo
58 58
      */
59 59
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
60 60
     {
61
-        if (!$dirs->has('locale')) {
62
-            $dirs->set('locale', $dirs->get('app') . 'locale/');
61
+        if (!$dirs->has('locale')){
62
+            $dirs->set('locale', $dirs->get('app').'locale/');
63 63
         }
64 64
 
65 65
         $this->config->setDefaults('translator', [
Please login to merge, or discard this patch.
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -58,7 +58,8 @@
 block discarded – undo
58 58
      */
59 59
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
60 60
     {
61
-        if (!$dirs->has('locale')) {
61
+        if (!$dirs->has('locale'))
62
+        {
62 63
             $dirs->set('locale', $dirs->get('app') . 'locale/');
63 64
         }
64 65
 
Please login to merge, or discard this patch.
src/Bootloader/CommandBootloader.php 2 patches
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,31 +75,31 @@  discard block
 block discarded – undo
75 75
      */
76 76
     private function configureExtensions(ConsoleBootloader $console, Container $container): void
77 77
     {
78
-        if ($container->has(DatabaseProviderInterface::class)) {
78
+        if ($container->has(DatabaseProviderInterface::class)){
79 79
             $this->configureDatabase($console);
80 80
         }
81 81
 
82
-        if ($container->has(ORMInterface::class)) {
82
+        if ($container->has(ORMInterface::class)){
83 83
             $this->configureCycle($console, $container);
84 84
         }
85 85
 
86
-        if ($container->has(TranslatorInterface::class)) {
86
+        if ($container->has(TranslatorInterface::class)){
87 87
             $this->configureTranslator($console);
88 88
         }
89 89
 
90
-        if ($container->has(ViewsInterface::class)) {
90
+        if ($container->has(ViewsInterface::class)){
91 91
             $this->configureViews($console);
92 92
         }
93 93
 
94
-        if ($container->has(Migrator::class)) {
94
+        if ($container->has(Migrator::class)){
95 95
             $this->configureMigrations($console);
96 96
         }
97 97
 
98
-        if ($container->has(InvokerInterface::class)) {
98
+        if ($container->has(InvokerInterface::class)){
99 99
             $this->configureGRPC($console);
100 100
         }
101 101
 
102
-        if ($container->has(EncryptionInterface::class)) {
102
+        if ($container->has(EncryptionInterface::class)){
103 103
             $this->configureEncrypter($console);
104 104
         }
105 105
     }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 
129 129
         $console->addCommand(Cycle\SyncCommand::class);
130 130
 
131
-        if ($container->has(Migrator::class)) {
131
+        if ($container->has(Migrator::class)){
132 132
             $console->addCommand(Cycle\MigrateCommand::class);
133 133
         }
134 134
     }
Please login to merge, or discard this patch.
Braces   +16 added lines, -8 removed lines patch added patch discarded remove patch
@@ -75,31 +75,38 @@  discard block
 block discarded – undo
75 75
      */
76 76
     private function configureExtensions(ConsoleBootloader $console, Container $container): void
77 77
     {
78
-        if ($container->has(DatabaseProviderInterface::class)) {
78
+        if ($container->has(DatabaseProviderInterface::class))
79
+        {
79 80
             $this->configureDatabase($console);
80 81
         }
81 82
 
82
-        if ($container->has(ORMInterface::class)) {
83
+        if ($container->has(ORMInterface::class))
84
+        {
83 85
             $this->configureCycle($console, $container);
84 86
         }
85 87
 
86
-        if ($container->has(TranslatorInterface::class)) {
88
+        if ($container->has(TranslatorInterface::class))
89
+        {
87 90
             $this->configureTranslator($console);
88 91
         }
89 92
 
90
-        if ($container->has(ViewsInterface::class)) {
93
+        if ($container->has(ViewsInterface::class))
94
+        {
91 95
             $this->configureViews($console);
92 96
         }
93 97
 
94
-        if ($container->has(Migrator::class)) {
98
+        if ($container->has(Migrator::class))
99
+        {
95 100
             $this->configureMigrations($console);
96 101
         }
97 102
 
98
-        if ($container->has(InvokerInterface::class)) {
103
+        if ($container->has(InvokerInterface::class))
104
+        {
99 105
             $this->configureGRPC($console);
100 106
         }
101 107
 
102
-        if ($container->has(EncryptionInterface::class)) {
108
+        if ($container->has(EncryptionInterface::class))
109
+        {
103 110
             $this->configureEncrypter($console);
104 111
         }
105 112
     }
@@ -128,7 +135,8 @@  discard block
 block discarded – undo
128 135
 
129 136
         $console->addCommand(Cycle\SyncCommand::class);
130 137
 
131
-        if ($container->has(Migrator::class)) {
138
+        if ($container->has(Migrator::class))
139
+        {
132 140
             $console->addCommand(Cycle\MigrateCommand::class);
133 141
         }
134 142
     }
Please login to merge, or discard this patch.
src/Bootloader/Views/ViewsBootloader.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -42,15 +42,15 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
44 44
     {
45
-        if (!$dirs->has('views')) {
46
-            $dirs->set('views', $dirs->get('app') . 'views');
45
+        if (!$dirs->has('views')){
46
+            $dirs->set('views', $dirs->get('app').'views');
47 47
         }
48 48
 
49 49
         // default view config
50 50
         $this->config->setDefaults('views', [
51 51
             'cache'        => [
52 52
                 'enabled'   => !$env->get('DEBUG', false),
53
-                'directory' => $dirs->get('cache') . 'views'
53
+                'directory' => $dirs->get('cache').'views'
54 54
             ],
55 55
             'namespaces'   => [
56 56
                 'default' => [$dirs->get('views')]
@@ -66,11 +66,11 @@  discard block
 block discarded – undo
66 66
      */
67 67
     public function addDirectory(string $namespace, string $directory): void
68 68
     {
69
-        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) {
69
+        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])){
70 70
             $this->config->modify('views', new Append('namespaces', $namespace, []));
71 71
         }
72 72
 
73
-        $this->config->modify('views', new Append('namespaces.' . $namespace, null, $directory));
73
+        $this->config->modify('views', new Append('namespaces.'.$namespace, null, $directory));
74 74
     }
75 75
 
76 76
     /**
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -42,7 +42,8 @@  discard block
 block discarded – undo
42 42
      */
43 43
     public function boot(EnvironmentInterface $env, DirectoriesInterface $dirs): void
44 44
     {
45
-        if (!$dirs->has('views')) {
45
+        if (!$dirs->has('views'))
46
+        {
46 47
             $dirs->set('views', $dirs->get('app') . 'views');
47 48
         }
48 49
 
@@ -66,7 +67,8 @@  discard block
 block discarded – undo
66 67
      */
67 68
     public function addDirectory(string $namespace, string $directory): void
68 69
     {
69
-        if (!isset($this->config->getConfig('views')['namespaces'][$namespace])) {
70
+        if (!isset($this->config->getConfig('views')['namespaces'][$namespace]))
71
+        {
70 72
             $this->config->modify('views', new Append('namespaces', $namespace, []));
71 73
         }
72 74
 
Please login to merge, or discard this patch.
src/Framework/Kernel.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -43,28 +43,28 @@
 block discarded – undo
43 43
      */
44 44
     protected function mapDirectories(array $directories): array
45 45
     {
46
-        if (!isset($directories['root'])) {
46
+        if (!isset($directories['root'])){
47 47
             throw new BootException('Missing required directory `root`.');
48 48
         }
49 49
 
50
-        if (!isset($directories['app'])) {
51
-            $directories['app'] = $directories['root'] . '/app/';
50
+        if (!isset($directories['app'])){
51
+            $directories['app'] = $directories['root'].'/app/';
52 52
         }
53 53
 
54 54
         return array_merge([
55 55
             // public root
56
-            'public'    => $directories['root'] . '/public/',
56
+            'public'    => $directories['root'].'/public/',
57 57
 
58 58
             // vendor libraries
59
-            'vendor'    => $directories['root'] . '/vendor/',
59
+            'vendor'    => $directories['root'].'/vendor/',
60 60
 
61 61
             // data directories
62
-            'runtime'   => $directories['root'] . '/runtime/',
63
-            'cache'     => $directories['root'] . '/runtime/cache/',
62
+            'runtime'   => $directories['root'].'/runtime/',
63
+            'cache'     => $directories['root'].'/runtime/cache/',
64 64
 
65 65
             // application directories
66
-            'config'    => $directories['app'] . '/config/',
67
-            'resources' => $directories['app'] . '/resources/',
66
+            'config'    => $directories['app'].'/config/',
67
+            'resources' => $directories['app'].'/resources/',
68 68
         ], $directories);
69 69
     }
70 70
 }
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,11 +43,13 @@
 block discarded – undo
43 43
      */
44 44
     protected function mapDirectories(array $directories): array
45 45
     {
46
-        if (!isset($directories['root'])) {
46
+        if (!isset($directories['root']))
47
+        {
47 48
             throw new BootException('Missing required directory `root`.');
48 49
         }
49 50
 
50
-        if (!isset($directories['app'])) {
51
+        if (!isset($directories['app']))
52
+        {
51 53
             $directories['app'] = $directories['root'] . '/app/';
52 54
         }
53 55
 
Please login to merge, or discard this patch.
src/Command/Database/ListCommand.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,13 +32,13 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function perform(DatabaseConfig $config, DatabaseManager $dbal): void
34 34
     {
35
-        if ($this->argument('db')) {
35
+        if ($this->argument('db')){
36 36
             $databases = [$this->argument('db')];
37
-        } else {
37
+        }else{
38 38
             $databases = array_keys($config->getDatabases());
39 39
         }
40 40
 
41
-        if (empty($databases)) {
41
+        if (empty($databases)){
42 42
             $this->writeln('<fg=red>No databases found.</fg=red>');
43 43
 
44 44
             return;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
             'Count Records:'
55 55
         ]);
56 56
 
57
-        foreach ($databases as $database) {
57
+        foreach ($databases as $database){
58 58
             $database = $dbal->database($database);
59 59
 
60 60
             /** @var Driver $driver */
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
                 $database->getPrefix() ?: '<comment>---</comment>'
68 68
             ];
69 69
 
70
-            try {
70
+            try{
71 71
                 $driver->connect();
72
-            } catch (\Exception $exception) {
72
+            }catch (\Exception $exception){
73 73
                 $this->renderException($grid, $header, $exception);
74 74
 
75
-                if ($database->getName() != end($databases)) {
75
+                if ($database->getName() != end($databases)){
76 76
                     $grid->addRow(new TableSeparator());
77 77
                 }
78 78
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
 
82 82
             $header[] = '<info>connected</info>';
83 83
             $this->renderTables($grid, $header, $database);
84
-            if ($database->getName() != end($databases)) {
84
+            if ($database->getName() != end($databases)){
85 85
                 $grid->addRow(new TableSeparator());
86 86
             }
87 87
         }
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     private function renderTables(Table $grid, array $header, Database $database): void
115 115
     {
116
-        foreach ($database->getTables() as $table) {
116
+        foreach ($database->getTables() as $table){
117 117
             $grid->addRow(array_merge(
118 118
                 $header,
119 119
                 [$table->getName(), number_format($table->count())]
Please login to merge, or discard this patch.
Braces   +20 added lines, -9 removed lines patch added patch discarded remove patch
@@ -32,13 +32,17 @@  discard block
 block discarded – undo
32 32
      */
33 33
     public function perform(DatabaseConfig $config, DatabaseManager $dbal): void
34 34
     {
35
-        if ($this->argument('db')) {
35
+        if ($this->argument('db'))
36
+        {
36 37
             $databases = [$this->argument('db')];
37
-        } else {
38
+        }
39
+        else
40
+        {
38 41
             $databases = array_keys($config->getDatabases());
39 42
         }
40 43
 
41
-        if (empty($databases)) {
44
+        if (empty($databases))
45
+        {
42 46
             $this->writeln('<fg=red>No databases found.</fg=red>');
43 47
 
44 48
             return;
@@ -54,7 +58,8 @@  discard block
 block discarded – undo
54 58
             'Count Records:'
55 59
         ]);
56 60
 
57
-        foreach ($databases as $database) {
61
+        foreach ($databases as $database)
62
+        {
58 63
             $database = $dbal->database($database);
59 64
 
60 65
             /** @var Driver $driver */
@@ -67,12 +72,16 @@  discard block
 block discarded – undo
67 72
                 $database->getPrefix() ?: '<comment>---</comment>'
68 73
             ];
69 74
 
70
-            try {
75
+            try
76
+            {
71 77
                 $driver->connect();
72
-            } catch (\Exception $exception) {
78
+            }
79
+            catch (\Exception $exception)
80
+            {
73 81
                 $this->renderException($grid, $header, $exception);
74 82
 
75
-                if ($database->getName() != end($databases)) {
83
+                if ($database->getName() != end($databases))
84
+                {
76 85
                     $grid->addRow(new TableSeparator());
77 86
                 }
78 87
 
@@ -81,7 +90,8 @@  discard block
 block discarded – undo
81 90
 
82 91
             $header[] = '<info>connected</info>';
83 92
             $this->renderTables($grid, $header, $database);
84
-            if ($database->getName() != end($databases)) {
93
+            if ($database->getName() != end($databases))
94
+            {
85 95
                 $grid->addRow(new TableSeparator());
86 96
             }
87 97
         }
@@ -113,7 +123,8 @@  discard block
 block discarded – undo
113 123
      */
114 124
     private function renderTables(Table $grid, array $header, Database $database): void
115 125
     {
116
-        foreach ($database->getTables() as $table) {
126
+        foreach ($database->getTables() as $table)
127
+        {
117 128
             $grid->addRow(array_merge(
118 129
                 $header,
119 130
                 [$table->getName(), number_format($table->count())]
Please login to merge, or discard this patch.
src/Command/Migrate/MigrateCommand.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function perform(): void
26 26
     {
27
-        if (!$this->verifyConfigured() || !$this->verifyEnvironment()) {
27
+        if (!$this->verifyConfigured() || !$this->verifyEnvironment()){
28 28
             return;
29 29
         }
30 30
 
31 31
         $found = false;
32 32
         $count = $this->option('one') ? 1 : PHP_INT_MAX;
33 33
 
34
-        while ($count > 0 && ($migration = $this->migrator->run())) {
34
+        while ($count > 0 && ($migration = $this->migrator->run())){
35 35
             $found = true;
36 36
             $count--;
37 37
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
             );
42 42
         }
43 43
 
44
-        if (!$found) {
44
+        if (!$found){
45 45
             $this->writeln('<fg=red>No outstanding migrations were found.</fg=red>');
46 46
         }
47 47
     }
Please login to merge, or discard this patch.
Braces   +6 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,16 @@  discard block
 block discarded – undo
24 24
      */
25 25
     public function perform(): void
26 26
     {
27
-        if (!$this->verifyConfigured() || !$this->verifyEnvironment()) {
27
+        if (!$this->verifyConfigured() || !$this->verifyEnvironment())
28
+        {
28 29
             return;
29 30
         }
30 31
 
31 32
         $found = false;
32 33
         $count = $this->option('one') ? 1 : PHP_INT_MAX;
33 34
 
34
-        while ($count > 0 && ($migration = $this->migrator->run())) {
35
+        while ($count > 0 && ($migration = $this->migrator->run()))
36
+        {
35 37
             $found = true;
36 38
             $count--;
37 39
 
@@ -41,7 +43,8 @@  discard block
 block discarded – undo
41 43
             );
42 44
         }
43 45
 
44
-        if (!$found) {
46
+        if (!$found)
47
+        {
45 48
             $this->writeln('<fg=red>No outstanding migrations were found.</fg=red>');
46 49
         }
47 50
     }
Please login to merge, or discard this patch.