Test Failed
Push — develop ( 5ff630...7f862e )
by nguereza
03:35
created
storage/migrations/20210705_065247_add_roles_table.php 3 patches
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -9,26 +9,26 @@
 block discarded – undo
9 9
 
10 10
     public function up(): void
11 11
     {
12
-      //Action when migrate up
13
-      $this->create('roles', function (CreateTable $table) {
14
-          $table->integer('id')
15
-                  ->autoincrement()
16
-                 ->primary();
17
-          $table->string('description')
18
-                 ->description('The role description');
19
-          $table->datetime('created_at')
20
-                  ->description('role created at')
21
-                  ->notNull();
22
-          $table->datetime('updated_at')
23
-                  ->description('role updated at');
12
+        //Action when migrate up
13
+        $this->create('roles', function (CreateTable $table) {
14
+            $table->integer('id')
15
+                    ->autoincrement()
16
+                    ->primary();
17
+            $table->string('description')
18
+                    ->description('The role description');
19
+            $table->datetime('created_at')
20
+                    ->description('role created at')
21
+                    ->notNull();
22
+            $table->datetime('updated_at')
23
+                    ->description('role updated at');
24 24
 
25
-          $table->engine('INNODB');
26
-      });
25
+            $table->engine('INNODB');
26
+        });
27 27
     }
28 28
 
29 29
     public function down(): void
30 30
     {
31
-      //Action when migrate down
32
-      $this->drop('roles');
31
+        //Action when migrate down
32
+        $this->drop('roles');
33 33
     }
34 34
 }
35 35
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     public function up(): void
11 11
     {
12 12
       //Action when migrate up
13
-      $this->create('roles', function (CreateTable $table) {
13
+      $this->create('roles', function(CreateTable $table) {
14 14
           $table->integer('id')
15 15
                   ->autoincrement()
16 16
                  ->primary();
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 use Platine\Database\Schema\CreateTable;
5 5
 use Platine\Framework\Migration\AbstractMigration;
6 6
 
7
-class AddRolesTable20210705065247 extends AbstractMigration
8
-{
7
+class AddRolesTable20210705065247 extends AbstractMigration {
9 8
 
10 9
     public function up(): void
11 10
     {
Please login to merge, or discard this patch.
storage/migrations/20210705_065339_add_roles_code_field.php 3 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,18 +9,18 @@
 block discarded – undo
9 9
 
10 10
     public function up(): void
11 11
     {
12
-      //Action when migrate up
13
-      $this->alter('roles', function (AlterTable $table) {
14
-          $table->string('code')->notNull();
15
-          $table->unique('code');
16
-      });
12
+        //Action when migrate up
13
+        $this->alter('roles', function (AlterTable $table) {
14
+            $table->string('code')->notNull();
15
+            $table->unique('code');
16
+        });
17 17
     }
18 18
 
19 19
     public function down(): void
20 20
     {
21
-      //Action when migrate down
22
-      $this->alter('roles', function (AlterTable $table) {
23
-          $table->dropColumn('code');
24
-      });
21
+        //Action when migrate down
22
+        $this->alter('roles', function (AlterTable $table) {
23
+            $table->dropColumn('code');
24
+        });
25 25
     }
26 26
 }
27 27
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
     public function up(): void
11 11
     {
12 12
       //Action when migrate up
13
-      $this->alter('roles', function (AlterTable $table) {
13
+      $this->alter('roles', function(AlterTable $table) {
14 14
           $table->string('code')->notNull();
15 15
           $table->unique('code');
16 16
       });
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
     public function down(): void
20 20
     {
21 21
       //Action when migrate down
22
-      $this->alter('roles', function (AlterTable $table) {
22
+      $this->alter('roles', function(AlterTable $table) {
23 23
           $table->dropColumn('code');
24 24
       });
25 25
     }
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 use Platine\Database\Schema\AlterTable;
5 5
 use Platine\Framework\Migration\AbstractMigration;
6 6
 
7
-class AddRolesCodeField20210705065339 extends AbstractMigration
8
-{
7
+class AddRolesCodeField20210705065339 extends AbstractMigration {
9 8
 
10 9
     public function up(): void
11 10
     {
Please login to merge, or discard this patch.
src/Service/Provider/DatabaseConfigServiceProvider.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@
 block discarded – undo
65 65
      */
66 66
     public function register(): void
67 67
     {
68
-        $this->app->share(DbConfig::class, function (ContainerInterface $app) {
68
+        $this->app->share(DbConfig::class, function(ContainerInterface $app) {
69 69
             $env = $app->get(Config::class)->get('app.env', '');
70 70
             return new DbConfig($app->get(QueryBuilder::class), $env);
71 71
         });
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@
 block discarded – undo
57 57
  * class DatabaseConfigServiceProvider
58 58
  * @package Platine\Framework\Service\Provider
59 59
  */
60
-class DatabaseConfigServiceProvider extends ServiceProvider
61
-{
60
+class DatabaseConfigServiceProvider extends ServiceProvider {
62 61
 
63 62
     /**
64 63
      * {@inheritdoc}
Please login to merge, or discard this patch.
src/Demo/Action/User/ListAction.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,7 @@
 block discarded – undo
15 15
  *
16 16
  * @author tony
17 17
  */
18
-class ListAction implements RequestHandlerInterface
19
-{
18
+class ListAction implements RequestHandlerInterface {
20 19
     protected UserRepository $userRepository;
21 20
     protected Template $template;
22 21
     protected DbConfig $dbConfig;
Please login to merge, or discard this patch.
src/Demo/Provider/UserServiceProvider.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -61,8 +61,7 @@
 block discarded – undo
61 61
  * class UserServiceProvider
62 62
  * @package Platine\Framework
63 63
  */
64
-class UserServiceProvider extends ServiceProvider
65
-{
64
+class UserServiceProvider extends ServiceProvider {
66 65
 
67 66
     /**
68 67
      * {@inheritdoc}
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -83,7 +83,7 @@
 block discarded – undo
83 83
      */
84 84
     public function addRoutes(Router $router): void
85 85
     {
86
-        $router->group('/users', function (Router $router) {
86
+        $router->group('/users', function(Router $router) {
87 87
             $router->get('', ListAction::class, 'user_list', ['permission' => 'users']);
88 88
             $router->get('/detail/{id:i}', DetailAction::class, 'user_detail');
89 89
             $router->get('/delete/{id:i}', DeleteAction::class, 'user_delete');
Please login to merge, or discard this patch.
src/Migration/Command/MigrationExecuteCommand.php 3 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
  * class MigrationExecuteCommand
59 59
  * @package Platine\Framework\Migration\Command
60 60
  */
61
-class MigrationExecuteCommand extends AbstractCommand
62
-{
61
+class MigrationExecuteCommand extends AbstractCommand {
63 62
 
64 63
     /**
65 64
      * Create new instance
@@ -91,8 +90,7 @@  discard block
 block discarded – undo
91 90
     /**
92 91
      * {@inheritodc}
93 92
      */
94
-    public function execute()
95
-    {
93
+    public function execute() {
96 94
         $type = $this->getArgumentValue('type');
97 95
 
98 96
         $io = $this->io();
Please login to merge, or discard this patch.
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
     ) {
73 73
         parent::__construct($app, $repository, $config, $filesystem);
74 74
         $this->setName('migration:exec')
75
-             ->setDescription('Execute the migration up/down for one version');
75
+                ->setDescription('Execute the migration up/down for one version');
76 76
 
77 77
         $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function ($val) {
78 78
             if (!in_array($val, ['up', 'down'])) {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
                 ));
83 83
             }
84 84
 
85
-             return $val;
85
+                return $val;
86 86
         });
87 87
 
88 88
         $this->addOption('-i|--id', 'the migration version', null, false, true);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@
 block discarded – undo
74 74
         $this->setName('migration:exec')
75 75
              ->setDescription('Execute the migration up/down for one version');
76 76
 
77
-        $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function ($val) {
77
+        $this->addArgument('type', 'type of migration [up|down]', 'up', true, true, false, function($val) {
78 78
             if (!in_array($val, ['up', 'down'])) {
79 79
                 throw new RuntimeException(sprintf(
80 80
                     'Invalid argument type [%s], must be one of [up, down]',
Please login to merge, or discard this patch.
src/Config/DbConfig.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -54,8 +54,7 @@  discard block
 block discarded – undo
54 54
  * class DbConfig
55 55
  * @package Platine\Framework\Config
56 56
  */
57
-class DbConfig extends Config
58
-{
57
+class DbConfig extends Config {
59 58
 
60 59
     /**
61 60
      * The Query Builder instance
@@ -68,8 +67,7 @@  discard block
 block discarded – undo
68 67
      * @param QueryBuilder $queryBuilder
69 68
      * @param string $env
70 69
      */
71
-    public function __construct(QueryBuilder $queryBuilder, string $env = '')
72
-    {
70
+    public function __construct(QueryBuilder $queryBuilder, string $env = '') {
73 71
         $this->queryBuilder = $queryBuilder;
74 72
         parent::__construct(new DatabaseConfigLoader($queryBuilder, 'config'), $env);
75 73
     }
Please login to merge, or discard this patch.
storage/migrations/20210708_043103_add_config_table.php 3 patches
Indentation   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -9,44 +9,44 @@
 block discarded – undo
9 9
 
10 10
     public function up(): void
11 11
     {
12
-      //Action when migrate up
13
-      $this->create('config', function (CreateTable $table) {
14
-          $table->integer('id')
15
-                  ->autoincrement()
16
-                 ->primary();
17
-          $table->string('env')
18
-                 ->description('The config environment')
19
-                 ->index();
20
-          $table->string('module')
21
-                 ->description('The module')
22
-                 ->index();
23
-          $table->string('code')
24
-                 ->description('The config code')
25
-                  ->notNull()
26
-                  ->index();
27
-          $table->string('value')
28
-                 ->description('The config value');
29
-          $table->string('type')
30
-                 ->description('The config data type');
31
-          $table->text('comment')
32
-                 ->description('The config description');
33
-          $table->integer('status')
34
-                 ->description('The config status')
35
-                 ->defaultValue(0)
36
-                 ->notNull();
37
-          $table->datetime('created_at')
38
-                  ->description('role created at')
39
-                  ->notNull();
40
-          $table->datetime('updated_at')
41
-                  ->description('role updated at');
12
+        //Action when migrate up
13
+        $this->create('config', function (CreateTable $table) {
14
+            $table->integer('id')
15
+                    ->autoincrement()
16
+                    ->primary();
17
+            $table->string('env')
18
+                    ->description('The config environment')
19
+                    ->index();
20
+            $table->string('module')
21
+                    ->description('The module')
22
+                    ->index();
23
+            $table->string('code')
24
+                    ->description('The config code')
25
+                    ->notNull()
26
+                    ->index();
27
+            $table->string('value')
28
+                    ->description('The config value');
29
+            $table->string('type')
30
+                    ->description('The config data type');
31
+            $table->text('comment')
32
+                    ->description('The config description');
33
+            $table->integer('status')
34
+                    ->description('The config status')
35
+                    ->defaultValue(0)
36
+                    ->notNull();
37
+            $table->datetime('created_at')
38
+                    ->description('role created at')
39
+                    ->notNull();
40
+            $table->datetime('updated_at')
41
+                    ->description('role updated at');
42 42
 
43
-          $table->engine('INNODB');
44
-      });
43
+            $table->engine('INNODB');
44
+        });
45 45
     }
46 46
 
47 47
     public function down(): void
48 48
     {
49
-      //Action when migrate down
50
-      $this->drop('config');
49
+        //Action when migrate down
50
+        $this->drop('config');
51 51
     }
52 52
 }
53 53
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
     public function up(): void
11 11
     {
12 12
       //Action when migrate up
13
-      $this->create('config', function (CreateTable $table) {
13
+      $this->create('config', function(CreateTable $table) {
14 14
           $table->integer('id')
15 15
                   ->autoincrement()
16 16
                  ->primary();
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,7 @@
 block discarded – undo
4 4
 use Platine\Database\Schema\CreateTable;
5 5
 use Platine\Framework\Migration\AbstractMigration;
6 6
 
7
-class AddConfigTable20210708043103 extends AbstractMigration
8
-{
7
+class AddConfigTable20210708043103 extends AbstractMigration {
9 8
 
10 9
     public function up(): void
11 10
     {
Please login to merge, or discard this patch.
src/Config/DatabaseConfigLoader.php 3 patches
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -157,13 +157,13 @@
 block discarded – undo
157 157
         foreach ($results as $cfg) {
158 158
             if ($cfg->parent) {
159 159
                 $results = $this->queryBuilder
160
-                              ->from($this->table)
161
-                              ->where('env')->is($cfg->env)
162
-                              ->where('module')->is($cfg->parent)
163
-                              ->where('status')->is(1)
164
-                              ->select()
165
-                              ->fetchObject()
166
-                              ->all();
160
+                                ->from($this->table)
161
+                                ->where('env')->is($cfg->env)
162
+                                ->where('module')->is($cfg->parent)
163
+                                ->where('status')->is(1)
164
+                                ->select()
165
+                                ->fetchObject()
166
+                                ->all();
167 167
 
168 168
                 foreach ($results as $cfg) {
169 169
                     $config[$cfg->name] = $cfg->value ?? $cfg->default_value;
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
      */
130 130
     protected function parse(string $env): array
131 131
     {
132
-        $environments = array_filter((array)preg_split('/(\/|\.)/', $env));
132
+        $environments = array_filter((array) preg_split('/(\/|\.)/', $env));
133 133
         array_unshift($environments, '');
134 134
 
135 135
         return $environments;
@@ -183,7 +183,7 @@  discard block
 block discarded – undo
183 183
     {
184 184
         $results = $this->queryBuilder
185 185
                         ->from($this->table)
186
-                        ->where('id')->in(function (SubQuery $q) use ($env, $group) {
186
+                        ->where('id')->in(function(SubQuery $q) use ($env, $group) {
187 187
                             $query = $q->from($this->table)
188 188
                             ->where('module')->is($group)
189 189
                             ->where('status')->is(1)
@@ -194,8 +194,8 @@  discard block
 block discarded – undo
194 194
                                 $query->where('env')->is($env);
195 195
                             }
196 196
 
197
-                            $query->select(function (ColumnExpression $cexp) {
198
-                                $cexp->column(function (Expression $exp) {
197
+                            $query->select(function(ColumnExpression $cexp) {
198
+                                $cexp->column(function(Expression $exp) {
199 199
                                     $exp->op('COALESCE');
200 200
                                 });
201 201
                             });
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -57,8 +57,7 @@  discard block
 block discarded – undo
57 57
  * class DatabaseConfigLoader
58 58
  * @package Platine\Framework\Config
59 59
  */
60
-class DatabaseConfigLoader implements LoaderInterface
61
-{
60
+class DatabaseConfigLoader implements LoaderInterface {
62 61
 
63 62
     /**
64 63
      * The QueryBuilder instance
@@ -179,8 +178,7 @@  discard block
 block discarded – undo
179 178
      * @param string|null $env
180 179
      * @return mixed
181 180
      */
182
-    public function getConfigurations(string $group, ?string $env = null)
183
-    {
181
+    public function getConfigurations(string $group, ?string $env = null) {
184 182
         $results = $this->queryBuilder
185 183
                         ->from($this->table)
186 184
                         ->where('id')->in(function (SubQuery $q) use ($env, $group) {
Please login to merge, or discard this patch.