Completed
Branch master (7d0793)
by P.R.
03:26
created
src/MySql/DataLayer.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -109,14 +109,14 @@  discard block
 block discarded – undo
109 109
                                             $additionSql)
110 110
   {
111 111
     $helper = new CreateAuditTrigger($dataSchemaName,
112
-                                     $auditSchemaName,
113
-                                     $tableName,
114
-                                     $triggerAction,
115
-                                     $triggerName,
116
-                                     $tableColumns,
117
-                                     $auditColumns,
118
-                                     $skipVariable,
119
-                                     $additionSql);
112
+                                      $auditSchemaName,
113
+                                      $tableName,
114
+                                      $triggerAction,
115
+                                      $triggerName,
116
+                                      $tableColumns,
117
+                                      $auditColumns,
118
+                                      $skipVariable,
119
+                                      $additionSql);
120 120
     $sql    = $helper->buildStatement();
121 121
 
122 122
     self::executeNone($sql);
@@ -259,8 +259,8 @@  discard block
 block discarded – undo
259 259
 where  TABLE_SCHEMA = %s
260 260
 and    TABLE_NAME   = %s
261 261
 order by ORDINAL_POSITION',
262
-                   self::$dl->quoteString($schemaName),
263
-                   self::$dl->quoteString($tableName));
262
+                    self::$dl->quoteString($schemaName),
263
+                    self::$dl->quoteString($tableName));
264 264
 
265 265
     return self::$dl->executeRows($sql);
266 266
   }
@@ -284,8 +284,8 @@  discard block
 block discarded – undo
284 284
 inner join information_schema.COLLATION_CHARACTER_SET_APPLICABILITY t2  on  t2.COLLATION_NAME = t1.TABLE_COLLATION
285 285
 WHERE t1.TABLE_SCHEMA = %s
286 286
 AND   t1.TABLE_NAME   = %s',
287
-                   self::$dl->quoteString($schemaName),
288
-                   self::$dl->quoteString($tableName));
287
+                    self::$dl->quoteString($schemaName),
288
+                    self::$dl->quoteString($tableName));
289 289
 
290 290
     return self::$dl->executeRow1($sql);
291 291
   }
@@ -307,8 +307,8 @@  discard block
 block discarded – undo
307 307
 where  TRIGGER_SCHEMA     = %s
308 308
 and    EVENT_OBJECT_TABLE = %s
309 309
 order by Trigger_Name',
310
-                   self::$dl->quoteString($schemaName),
311
-                   self::$dl->quoteString($tableName));
310
+                    self::$dl->quoteString($schemaName),
311
+                    self::$dl->quoteString($tableName));
312 312
 
313 313
     return self::$dl->executeRows($sql);
314 314
   }
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
                                      $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.
src/MySql/Command/AuditCommand.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -153,7 +153,7 @@
 block discarded – undo
153 153
                                   $this->config['audit_columns'],
154 154
                                   $this->config['tables'][$table['table_name']]['alias'],
155 155
                                   $this->config['tables'][$table['table_name']]['skip']);
156
-        $res          = StaticDataLayer::searchInRowSet('table_name', $currentTable->getTableName(), $this->auditSchemaTables);
156
+        $res = StaticDataLayer::searchInRowSet('table_name', $currentTable->getTableName(), $this->auditSchemaTables);
157 157
         if (!isset($res))
158 158
         {
159 159
           $currentTable->createMissingAuditTable();
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -105,8 +105,8 @@  discard block
 block discarded – undo
105 105
       {
106 106
         $this->io->writeln(sprintf('<info>Found new table %s</info>', $table['table_name']));
107 107
         $this->config['tables'][$table['table_name']] = ['audit' => false,
108
-                                                         'alias' => null,
109
-                                                         'skip'  => null];
108
+                                                          'alias' => null,
109
+                                                          'skip'  => null];
110 110
       }
111 111
     }
112 112
   }
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
   protected function configure()
144 144
   {
145 145
     $this->setName('audit')
146
-         ->setDescription('Create (missing) audit table and (re)creates audit triggers')
147
-         ->addArgument('config file', InputArgument::OPTIONAL, 'The audit configuration file');
146
+          ->setDescription('Create (missing) audit table and (re)creates audit triggers')
147
+          ->addArgument('config file', InputArgument::OPTIONAL, 'The audit configuration file');
148 148
   }
149 149
 
150 150
   //--------------------------------------------------------------------------------------------------------------------
Please login to merge, or discard this patch.
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/DiffCommand.php 2 patches
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.
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
    *
54 54
    * @param array[] $columns The metadata of the columns of a table.
55 55
    *
56
-   * @return array[]
56
+   * @return \array[]
57 57
    */
58 58
   private static function removeMatchingColumns($columns)
59 59
   {
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
   /**
143 143
    * Add not null to audit columns if it not nullable.
144 144
    *
145
-   * @param array $theColumns Audit columns.
145
+   * @param \array[] $theColumns Audit columns.
146 146
    *
147 147
    * @return array
148 148
    */
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
    * @param Columns $dataColumns  The table columns from data schema.
174 174
    * @param Columns $auditColumns The table columns from audit schema.
175 175
    *
176
-   * @return \array[]
176
+   * @return ColumnTypesExtended
177 177
    */
178 178
   private function createDiffArray($dataColumns, $auditColumns)
179 179
   {
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/MySql/Table/Table.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -268,7 +268,7 @@
 block discarded – undo
268 268
   /**
269 269
    * Selects and returns the metadata of the columns of this table from information_schema.
270 270
    *
271
-   * @return array[]
271
+   * @return \array[]
272 272
    */
273 273
   private function getColumnsFromInformationSchema()
274 274
   {
Please login to merge, or discard this patch.
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
   private function getAlteredColumns()
260 260
   {
261 261
     $alteredColumnsTypes = Columns::differentColumnTypes($this->dataTableColumnsDatabase,
262
-                                                         $this->dataTableColumnsConfig);
262
+                                                          $this->dataTableColumnsConfig);
263 263
 
264 264
     return $alteredColumnsTypes;
265 265
   }
@@ -382,9 +382,9 @@  discard block
 block discarded – undo
382 382
     foreach ($alteredColumns as $column)
383 383
     {
384 384
       $this->io->logInfo('Type of <dbo>%s.%s</dbo> has been altered to <dbo>%s</dbo>',
385
-                         $this->tableName,
386
-                         $column['column_name'],
387
-                         $column['column_type']);
385
+                          $this->tableName,
386
+                          $column['column_name'],
387
+                          $column['column_type']);
388 388
     }
389 389
   }
390 390
 
Please login to merge, or discard this patch.
src/MySql/Helper/ColumnTypesExtended.php 1 patch
Unused Use Statements   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -3,8 +3,8 @@
 block discarded – undo
3 3
 namespace SetBased\Audit\MySql\Helper;
4 4
 
5 5
 //----------------------------------------------------------------------------------------------------------------------
6
-use SetBased\Audit\MySql\Table\Columns;
7 6
 use SetBased\Audit\MySQl\Table\ColumnType;
7
+use SetBased\Audit\MySql\Table\Columns;
8 8
 
9 9
 /**
10 10
  * A helper class for column types.
Please login to merge, or discard this patch.
src/MySql/Helper/TableHelper.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -94,9 +94,9 @@
 block discarded – undo
94 94
         $theName = $theOption;
95 95
       }
96 96
       $tableRow               = ['column_name'        => $theName,
97
-                                 'data_column_type'   => $this->dataTableOptions[$theOption],
98
-                                 'audit_column_type'  => $this->auditTableOptions[$theOption],
99
-                                 'config_column_type' => null];
97
+                                  'data_column_type'   => $this->dataTableOptions[$theOption],
98
+                                  'audit_column_type'  => $this->auditTableOptions[$theOption],
99
+                                  'config_column_type' => null];
100 100
       $this->rows[$theOption] = RowHelper::createTableRow($tableRow);
101 101
     }
102 102
   }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -93,7 +93,7 @@
 block discarded – undo
93 93
       {
94 94
         $theName = $theOption;
95 95
       }
96
-      $tableRow               = ['column_name'        => $theName,
96
+      $tableRow = ['column_name'        => $theName,
97 97
                                  'data_column_type'   => $this->dataTableOptions[$theOption],
98 98
                                  'audit_column_type'  => $this->auditTableOptions[$theOption],
99 99
                                  'config_column_type' => null];
Please login to merge, or discard this patch.
src/MySql/Helper/RowHelper.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -25,9 +25,9 @@  discard block
 block discarded – undo
25 25
     $auditCollationName = isset($theRow['audit_collation_name']) ? $theRow['audit_collation_name'] : null;
26 26
 
27 27
     $tableRow = ['column_name'      => null,
28
-                 'data_table_type'  => self::styledOptionsRow($dataCharsetName, $dataCollationName),
29
-                 'audit_table_type' => self::styledOptionsRow($auditCharsetName, $auditCollationName),
30
-                 'config_type'      => null];
28
+                  'data_table_type'  => self::styledOptionsRow($dataCharsetName, $dataCollationName),
29
+                  'audit_table_type' => self::styledOptionsRow($auditCharsetName, $auditCollationName),
30
+                  'config_type'      => null];
31 31
 
32 32
     return $tableRow;
33 33
   }
@@ -60,9 +60,9 @@  discard block
 block discarded – undo
60 60
   public static function createTableRow($theRow)
61 61
   {
62 62
     $tableRow = ['column_name'      => isset($theRow['column_name']) ? $theRow['column_name'] : null,
63
-                 'data_table_type'  => isset($theRow['data_column_type']) ? $theRow['data_column_type'] : null,
64
-                 'audit_table_type' => isset($theRow['audit_column_type']) ? $theRow['audit_column_type'] : null,
65
-                 'config_type'      => isset($theRow['config_column_type']) ? $theRow['config_column_type'] : null];
63
+                  'data_table_type'  => isset($theRow['data_column_type']) ? $theRow['data_column_type'] : null,
64
+                  'audit_table_type' => isset($theRow['audit_column_type']) ? $theRow['audit_column_type'] : null,
65
+                  'config_type'      => isset($theRow['config_column_type']) ? $theRow['config_column_type'] : null];
66 66
 
67 67
     return $tableRow;
68 68
   }
Please login to merge, or discard this patch.