Completed
Push — master ( 8e94f8...744b49 )
by P.R.
04:26
created
src/MySql/Metadata/TableColumnsMetadata.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -144,7 +144,7 @@
 block discarded – undo
144 144
    *
145 145
    * @param string $columnName The column name.
146 146
    *
147
-   * @return null|string
147
+   * @return integer|null
148 148
    */
149 149
   public function getPreviousColumn($columnName)
150 150
   {
Please login to merge, or discard this patch.
src/MySql/Command/AuditCommand.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,8 +22,8 @@
 block discarded – undo
22 22
   protected function configure()
23 23
   {
24 24
     $this->setName('audit')
25
-         ->setDescription('Create (missing) audit table and (re)creates audit triggers')
26
-         ->addArgument('config file', InputArgument::OPTIONAL, 'The audit configuration file');
25
+          ->setDescription('Create (missing) audit table and (re)creates audit triggers')
26
+          ->addArgument('config file', InputArgument::OPTIONAL, 'The audit configuration file');
27 27
   }
28 28
 
29 29
   //--------------------------------------------------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/MySql/Sql/CreateAuditTrigger.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -196,7 +196,7 @@
 block discarded – undo
196 196
     $columnNames = '';
197 197
 
198 198
     // First the audit columns.
199
-     foreach ($this->auditColumns->getColumns() as $column)
199
+      foreach ($this->auditColumns->getColumns() as $column)
200 200
     {
201 201
       if ($columnNames) $columnNames .= ',';
202 202
       $columnNames .= sprintf('`%s`', $column->getProperty('column_name'));
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@
 block discarded – undo
197 197
 
198 198
     // First the audit columns.
199 199
      foreach ($this->auditColumns->getColumns() as $column)
200
-    {
200
+     {
201 201
       if ($columnNames) $columnNames .= ',';
202 202
       $columnNames .= sprintf('`%s`', $column->getProperty('column_name'));
203 203
     }
Please login to merge, or discard this patch.
src/MySql/Audit.php 2 patches
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
       {
147 147
         $this->io->writeln(sprintf('<info>Found new table %s</info>', $table['table_name']));
148 148
         $this->config['tables'][$table['table_name']] = ['audit' => false,
149
-                                                         'alias' => null,
150
-                                                         'skip'  => null];
149
+                                                          'alias' => null,
150
+                                                          'skip'  => null];
151 151
       }
152 152
     }
153 153
   }
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
           $tableColumns = $this->config['table_columns'][$table['table_name']];
200 200
         }
201 201
         $configTable = new TableMetadata($table['table_name'],
202
-                                         $this->config['database']['data_schema'],
203
-                                         $tableColumns);
202
+                                          $this->config['database']['data_schema'],
203
+                                          $tableColumns);
204 204
 
205 205
         $currentTable = new AuditTable($this->io,
206
-                                       $configTable,
207
-                                       $this->config['database']['audit_schema'],
208
-                                       $this->auditColumnsMetadata,
209
-                                       $this->config['tables'][$table['table_name']]['alias'],
210
-                                       $this->config['tables'][$table['table_name']]['skip']);
206
+                                        $configTable,
207
+                                        $this->config['database']['audit_schema'],
208
+                                        $this->auditColumnsMetadata,
209
+                                        $this->config['tables'][$table['table_name']]['alias'],
210
+                                        $this->config['tables'][$table['table_name']]['skip']);
211 211
         $res          = StaticDataLayer::searchInRowSet('table_name',
212 212
                                                         $currentTable->getTableName(),
213 213
                                                         $this->auditSchemaTables);
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -208,7 +208,7 @@
 block discarded – undo
208 208
                                        $this->auditColumnsMetadata,
209 209
                                        $this->config['tables'][$table['table_name']]['alias'],
210 210
                                        $this->config['tables'][$table['table_name']]['skip']);
211
-        $res          = StaticDataLayer::searchInRowSet('table_name',
211
+        $res = StaticDataLayer::searchInRowSet('table_name',
212 212
                                                         $currentTable->getTableName(),
213 213
                                                         $this->auditSchemaTables);
214 214
         if (!isset($res))
Please login to merge, or discard this patch.
src/MySql/AuditTable.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
   public function createMissingAuditTable()
110 110
   {
111 111
     $this->io->logInfo('Creating audit table <dbo>%s.%s<dbo>',
112
-                       $this->auditSchemaName,
113
-                       $this->configTable->getTableName());
112
+                        $this->auditSchemaName,
113
+                        $this->configTable->getTableName());
114 114
 
115 115
     // In the audit table all columns from the data table must be nullable.
116 116
     $dataTableColumnsDatabase = clone($this->dataTableColumnsDatabase);
@@ -118,9 +118,9 @@  discard block
 block discarded – undo
118 118
 
119 119
     $columns = TableColumnsMetadata::combine($this->auditColumns, $dataTableColumnsDatabase);
120 120
     AuditDataLayer::createAuditTable($this->configTable->getSchemaName(),
121
-                                     $this->auditSchemaName,
122
-                                     $this->configTable->getTableName(),
123
-                                     $columns);
121
+                                      $this->auditSchemaName,
122
+                                      $this->configTable->getTableName(),
123
+                                      $columns);
124 124
   }
125 125
 
126 126
   //--------------------------------------------------------------------------------------------------------------------
@@ -240,14 +240,14 @@  discard block
 block discarded – undo
240 240
                           $this->configTable->getTableName());
241 241
 
242 242
     AuditDataLayer::createAuditTrigger($this->configTable->getSchemaName(),
243
-                                       $this->auditSchemaName,
244
-                                       $this->configTable->getTableName(),
245
-                                       $triggerName,
246
-                                       $action,
247
-                                       $this->auditColumns,
248
-                                       $this->dataTableColumnsDatabase,
249
-                                       $skipVariable,
250
-                                       $additionSql);
243
+                                        $this->auditSchemaName,
244
+                                        $this->configTable->getTableName(),
245
+                                        $triggerName,
246
+                                        $action,
247
+                                        $this->auditColumns,
248
+                                        $this->dataTableColumnsDatabase,
249
+                                        $skipVariable,
250
+                                        $additionSql);
251 251
   }
252 252
 
253 253
   //--------------------------------------------------------------------------------------------------------------------
@@ -411,9 +411,9 @@  discard block
 block discarded – undo
411 411
     foreach ($alteredColumns->getColumns() as $column)
412 412
     {
413 413
       $this->io->logInfo('Type of <dbo>%s.%s</dbo> has been altered to <dbo>%s</dbo>',
414
-                         $this->configTable->getTableName(),
415
-                         $column['column_name'],
416
-                         $column['column_type']);
414
+                          $this->configTable->getTableName(),
415
+                          $column['column_name'],
416
+                          $column['column_type']);
417 417
     }
418 418
   }
419 419
 
Please login to merge, or discard this patch.