Completed
Push — master ( 3c3a68...38d739 )
by P.R.
02:44
created
src/Command/AboutCommand.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -19,8 +19,8 @@
 block discarded – undo
19 19
   protected function configure()
20 20
   {
21 21
     $this->setName('about')
22
-         ->setDescription('Short information about AuditApplication')
23
-         ->setHelp('<info>audit about</info>');
22
+          ->setDescription('Short information about AuditApplication')
23
+          ->setHelp('<info>audit about</info>');
24 24
   }
25 25
 
26 26
   //--------------------------------------------------------------------------------------------------------------------
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@
 block discarded – undo
34 34
     $this->io->write(<<<EOT
35 35
 <info>AuditApplication - Database Auditing</info>
36 36
 <comment>Creates audit tables and triggers to track data changes in databases.</comment>
37
-EOT
37
+eot
38 38
     );
39 39
   }
40 40
 
Please login to merge, or discard this patch.
src/Command/BaseCommand.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,8 +70,8 @@
 block discarded – undo
70 70
       if ($mandatory)
71 71
       {
72 72
         throw new RuntimeException("Setting '%s' not found in section '%s' configuration file.",
73
-                                   $settingName,
74
-                                   $sectionName);
73
+                                    $settingName,
74
+                                    $sectionName);
75 75
       }
76 76
       else
77 77
       {
Please login to merge, or discard this patch.
src/Command/ConfigCommand.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@
 block discarded – undo
28 28
   protected function configure()
29 29
   {
30 30
     $this->setName('config')
31
-         ->setDescription('Create or edit config file')
32
-         ->addArgument('config file', InputArgument::OPTIONAL, 'The audit configuration file', 'etc/audit.json');
31
+          ->setDescription('Create or edit config file')
32
+          ->addArgument('config file', InputArgument::OPTIONAL, 'The audit configuration file', 'etc/audit.json');
33 33
   }
34 34
 
35 35
   //--------------------------------------------------------------------------------------------------------------------
Please login to merge, or discard this patch.
src/MySql/Command/DiffCommand.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -73,9 +73,9 @@
 block discarded – undo
73 73
   protected function configure()
74 74
   {
75 75
     $this->setName('diff')
76
-         ->setDescription('Compares data tables and audit tables')
77
-         ->addArgument('config file', InputArgument::OPTIONAL, 'The audit configuration file', 'etc/audit.json')
78
-         ->addOption('full', 'f', InputOption::VALUE_NONE, 'Show all columns');
76
+          ->setDescription('Compares data tables and audit tables')
77
+          ->addArgument('config file', InputArgument::OPTIONAL, 'The audit configuration file', 'etc/audit.json')
78
+          ->addOption('full', 'f', InputOption::VALUE_NONE, 'Show all columns');
79 79
   }
80 80
 
81 81
   //--------------------------------------------------------------------------------------------------------------------
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/AuditDataLayer.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -117,7 +117,7 @@
 block discarded – undo
117 117
                                      $auditColumns,
118 118
                                      $skipVariable,
119 119
                                      $additionSql);
120
-    $sql    = $helper->buildStatement();
120
+    $sql = $helper->buildStatement();
121 121
 
122 122
     self::executeNone($sql);
123 123
   }
Please login to merge, or discard this patch.
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -110,14 +110,14 @@  discard block
 block discarded – undo
110 110
                                             $additionSql)
111 111
   {
112 112
     $helper = new CreateAuditTrigger($dataSchemaName,
113
-                                     $auditSchemaName,
114
-                                     $tableName,
115
-                                     $triggerName,
116
-                                     $triggerAction,
117
-                                     $auditColumns,
118
-                                     $tableColumns,
119
-                                     $skipVariable,
120
-                                     $additionSql);
113
+                                      $auditSchemaName,
114
+                                      $tableName,
115
+                                      $triggerName,
116
+                                      $triggerAction,
117
+                                      $auditColumns,
118
+                                      $tableColumns,
119
+                                      $skipVariable,
120
+                                      $additionSql);
121 121
     $sql    = $helper->buildStatement();
122 122
 
123 123
     self::executeNone($sql);
@@ -302,8 +302,8 @@  discard block
 block discarded – undo
302 302
 where  TABLE_SCHEMA = %s
303 303
 and    TABLE_NAME   = %s
304 304
 order by ORDINAL_POSITION',
305
-                   self::$dl->quoteString($schemaName),
306
-                   self::$dl->quoteString($tableName));
305
+                    self::$dl->quoteString($schemaName),
306
+                    self::$dl->quoteString($tableName));
307 307
 
308 308
     return self::executeRows($sql);
309 309
   }
@@ -327,8 +327,8 @@  discard block
 block discarded – undo
327 327
 inner join information_schema.COLLATION_CHARACTER_SET_APPLICABILITY t2  on  t2.COLLATION_NAME = t1.TABLE_COLLATION
328 328
 WHERE t1.TABLE_SCHEMA = %s
329 329
 AND   t1.TABLE_NAME   = %s',
330
-                   self::$dl->quoteString($schemaName),
331
-                   self::$dl->quoteString($tableName));
330
+                    self::$dl->quoteString($schemaName),
331
+                    self::$dl->quoteString($tableName));
332 332
 
333 333
     return self::executeRow1($sql);
334 334
   }
@@ -350,8 +350,8 @@  discard block
 block discarded – undo
350 350
 where  TRIGGER_SCHEMA     = %s
351 351
 and    EVENT_OBJECT_TABLE = %s
352 352
 order by Trigger_Name',
353
-                   self::$dl->quoteString($schemaName),
354
-                   self::$dl->quoteString($tableName));
353
+                    self::$dl->quoteString($schemaName),
354
+                    self::$dl->quoteString($tableName));
355 355
 
356 356
     return self::executeRows($sql);
357 357
   }
@@ -393,7 +393,7 @@  discard block
 block discarded – undo
393 393
 where  TRIGGER_SCHEMA     = %s
394 394
 order by EVENT_OBJECT_TABLE
395 395
 ,        TRIGGER_NAME',
396
-                   self::$dl->quoteString($schemaName));
396
+                    self::$dl->quoteString($schemaName));
397 397
 
398 398
     return self::executeRows($sql);
399 399
   }
Please login to merge, or discard this patch.
src/MySql/Command/DropTriggersCommand.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
   protected function configure()
22 22
   {
23 23
     $this->setName('drop-triggers')
24
-         ->setDescription('Drops all triggers')
25
-         ->addArgument('config file', InputArgument::REQUIRED, 'The audit configuration file');
24
+          ->setDescription('Drops all triggers')
25
+          ->addArgument('config file', InputArgument::REQUIRED, 'The audit configuration file');
26 26
   }
27 27
 
28 28
   //--------------------------------------------------------------------------------------------------------------------
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
     foreach ($triggers as $trigger)
59 59
     {
60 60
       $this->io->logInfo('Dropping trigger <dbo>%s</dbo> from table <dbo>%s</dbo>',
61
-                         $trigger['trigger_name'],
62
-                         $trigger['table_name']);
61
+                          $trigger['trigger_name'],
62
+                          $trigger['table_name']);
63 63
 
64 64
       AuditDataLayer::dropTrigger($data_schema, $trigger['trigger_name']);
65 65
     }
Please login to merge, or discard this patch.
src/MySql/AuditTable.php 1 patch
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
   public function createAuditTable()
109 109
   {
110 110
     $this->io->logInfo('Creating audit table <dbo>%s.%s<dbo>',
111
-                       $this->auditSchemaName,
112
-                       $this->configTable->getTableName());
111
+                        $this->auditSchemaName,
112
+                        $this->configTable->getTableName());
113 113
 
114 114
     // In the audit table all columns from the data table must be nullable.
115 115
     $dataTableColumnsDatabase = clone($this->dataTableColumnsDatabase);
@@ -117,9 +117,9 @@  discard block
 block discarded – undo
117 117
 
118 118
     $columns = TableColumnsMetadata::combine($this->auditColumns, $dataTableColumnsDatabase);
119 119
     AuditDataLayer::createAuditTable($this->configTable->getSchemaName(),
120
-                                     $this->auditSchemaName,
121
-                                     $this->configTable->getTableName(),
122
-                                     $columns);
120
+                                      $this->auditSchemaName,
121
+                                      $this->configTable->getTableName(),
122
+                                      $columns);
123 123
   }
124 124
 
125 125
   //--------------------------------------------------------------------------------------------------------------------
@@ -242,14 +242,14 @@  discard block
 block discarded – undo
242 242
                           $this->configTable->getTableName());
243 243
 
244 244
     AuditDataLayer::createAuditTrigger($this->configTable->getSchemaName(),
245
-                                       $this->auditSchemaName,
246
-                                       $this->configTable->getTableName(),
247
-                                       $triggerName,
248
-                                       $action,
249
-                                       $this->auditColumns,
250
-                                       $this->dataTableColumnsDatabase,
251
-                                       $skipVariable,
252
-                                       $additionSql);
245
+                                        $this->auditSchemaName,
246
+                                        $this->configTable->getTableName(),
247
+                                        $triggerName,
248
+                                        $action,
249
+                                        $this->auditColumns,
250
+                                        $this->dataTableColumnsDatabase,
251
+                                        $skipVariable,
252
+                                        $additionSql);
253 253
   }
254 254
 
255 255
   //--------------------------------------------------------------------------------------------------------------------
@@ -366,23 +366,23 @@  discard block
 block discarded – undo
366 366
     foreach ($newColumns->getColumns() as $column)
367 367
     {
368 368
       $this->io->logInfo('New column <dbo>%s.%s</dbo>',
369
-                         $this->configTable->getTableName(),
370
-                         $column->getProperty('column_name'));
369
+                          $this->configTable->getTableName(),
370
+                          $column->getProperty('column_name'));
371 371
     }
372 372
 
373 373
     foreach ($obsoleteColumns->getColumns() as $column)
374 374
     {
375 375
       $this->io->logInfo('Obsolete column <dbo>%s.%s</dbo>',
376
-                         $this->configTable->getTableName(),
377
-                         $column->getProperty('column_name'));
376
+                          $this->configTable->getTableName(),
377
+                          $column->getProperty('column_name'));
378 378
     }
379 379
 
380 380
     foreach ($alteredColumns->getColumns() as $column)
381 381
     {
382 382
       $this->io->logInfo('Type of <dbo>%s.%s</dbo> has been altered to <dbo>%s</dbo>',
383
-                         $this->configTable->getTableName(),
384
-                         $column->getProperty('column_name'),
385
-                         $column->getProperty('column_type'));
383
+                          $this->configTable->getTableName(),
384
+                          $column->getProperty('column_name'),
385
+                          $column->getProperty('column_type'));
386 386
     }
387 387
   }
388 388
 
Please login to merge, or discard this patch.
src/MySql/AuditDiffTable.php 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
   /**
90 90
    * Check full and return array without new or obsolete columns if full not set.
91 91
    *
92
-   * @return DiffTableColumns
92
+   * @return TableColumnsMetadata
93 93
    */
94 94
   public function removeMatchingColumns()
95 95
   {
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
   /**
140 140
    * Add not null to audit columns if it not nullable.
141 141
    *
142
-   * @param array $theColumns Audit columns.
142
+   * @param \array[] $theColumns Audit columns.
143 143
    *
144
-   * @return array
144
+   * @return \array[]
145 145
    */
146 146
   private function addNotNull($theColumns)
147 147
   {
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -125,8 +125,7 @@
 block discarded – undo
125 125
           && $audit_character_set_name==$config_character_set_name
126 126
           && $audit_collation_name==$config_collation_name
127 127
           && $audit_collation_name==$data_collation_name
128
-        )
129
-        {
128
+        ) {
130 129
           $metadata->removeColumn($columnName);
131 130
         }
132 131
       }
Please login to merge, or discard this patch.