Test Failed
Push — develop ( ebbd0c...8a31ce )
by nguereza
03:10
created
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/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.
src/Migration/Command/MigrationMigrateCommand.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
     ) {
72 72
         parent::__construct($app, $repository, $config, $filesystem);
73 73
         $this->setName('migration:migrate')
74
-             ->setDescription('Upgrade migration to latest');
74
+                ->setDescription('Upgrade migration to latest');
75 75
     }
76 76
 
77 77
     /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
  * @template T
59 59
  * @extends AbstractCommand<T>
60 60
  */
61
-class MigrationMigrateCommand extends AbstractCommand
62
-{
61
+class MigrationMigrateCommand extends AbstractCommand {
63 62
 
64 63
     /**
65 64
      * Create new instance
@@ -79,8 +78,7 @@  discard block
 block discarded – undo
79 78
     /**
80 79
      * {@inheritodc}
81 80
      */
82
-    public function execute()
83
-    {
81
+    public function execute() {
84 82
         $io = $this->io();
85 83
         $writer = $io->writer();
86 84
         $writer->boldYellow('MIGRATION UPGRADE TO LATEST', true)->eol();
Please login to merge, or discard this patch.
src/Migration/Command/MigrationResetCommand.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@
 block discarded – undo
71 71
     ) {
72 72
         parent::__construct($app, $repository, $config, $filesystem);
73 73
         $this->setName('migration:reset')
74
-             ->setDescription('Rollback all migration done before');
74
+                ->setDescription('Rollback all migration done before');
75 75
     }
76 76
 
77 77
     /**
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@  discard block
 block discarded – undo
58 58
  * @template T
59 59
  * @extends AbstractCommand<T>
60 60
  */
61
-class MigrationResetCommand extends AbstractCommand
62
-{
61
+class MigrationResetCommand extends AbstractCommand {
63 62
 
64 63
     /**
65 64
      * Create new instance
@@ -79,8 +78,7 @@  discard block
 block discarded – undo
79 78
     /**
80 79
      * {@inheritodc}
81 80
      */
82
-    public function execute()
83
-    {
81
+    public function execute() {
84 82
         $io = $this->io();
85 83
         $writer = $io->writer();
86 84
         $writer->boldYellow('ALL MIGRATION ROLLBACK', true)->eol();
Please login to merge, or discard this patch.
src/Migration/Command/MigrationInitCommand.php 3 patches
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -80,8 +80,8 @@  discard block
 block discarded – undo
80 80
     ) {
81 81
         parent::__construct($app, $repository, $config, $filesystem);
82 82
         $this->setName('migration:init')
83
-             ->setDescription("Initialize the migration data. Note this command\n"
84
-                     . "is run only at the first time to create migration table");
83
+                ->setDescription("Initialize the migration data. Note this command\n"
84
+                        . "is run only at the first time to create migration table");
85 85
 
86 86
         $this->schema = $schema;
87 87
     }
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
         $tableName = $this->table;
120 120
         $this->schema->create($tableName, function (CreateTable $table) {
121 121
             $table->string('version', 20)
122
-                   ->description('The migration version')
123
-                   ->primary();
122
+                    ->description('The migration version')
123
+                    ->primary();
124 124
             $table->string('description')
125
-                   ->description('The migration description');
125
+                    ->description('The migration description');
126 126
             $table->datetime('created_at')
127 127
                     ->description('Migration run time');
128 128
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
     protected function createMigrationTable(): void
118 118
     {
119 119
         $tableName = $this->table;
120
-        $this->schema->create($tableName, function (CreateTable $table) {
120
+        $this->schema->create($tableName, function(CreateTable $table) {
121 121
             $table->string('version', 20)
122 122
                    ->description('The migration version')
123 123
                    ->primary();
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -60,8 +60,7 @@  discard block
 block discarded – undo
60 60
  * @template T
61 61
  * @extends AbstractCommand<T>
62 62
  */
63
-class MigrationInitCommand extends AbstractCommand
64
-{
63
+class MigrationInitCommand extends AbstractCommand {
65 64
 
66 65
     /**
67 66
      * The schema to use
@@ -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
         $io = $this->io();
97 95
         $writer = $io->writer();
98 96
         $writer->boldYellow('MIGRATION INITIALIZATION', true);
Please login to merge, or discard this patch.