@@ -40,7 +40,7 @@ class AuditTable
4040 *
4141 * @var string
4242 */
43- protected $ dataSchemaName ;
43+ private string $ dataSchemaName ;
4444
4545 /**
4646 * The metadata of the columns of the data table retrieved from information_schema.
@@ -57,7 +57,8 @@ class AuditTable
5757 private AuditStyle $ io ;
5858
5959 /**
60- * The skip variable for triggers.
60+ * The name of the MySQL user defined variable for skipping triggers. When the value of this variable is not null the
61+ * audit trigger will (effectively) be sipped.
6162 *
6263 * @var string|null
6364 */
@@ -79,16 +80,17 @@ class AuditTable
7980 * @param string $auditSchemaName The name of the schema with audit tables.
8081 * @param string $tableName The name of the data and audit table.
8182 * @param TableColumnsMetadata $additionalAuditColumns The metadata of the additional audit columns.
82- * @param string|null $alias An unique alias for this table.
83- * @param string|null $skipVariable The skip variable
83+ * @param string|null $alias A unique alias for this table.
84+ * @param string|null $skipVariable The name of the MySQL user defined variable for skipping
85+ * triggers.
8486 */
85- public function __construct (AuditStyle $ io ,
86- string $ dataSchemaName ,
87- string $ auditSchemaName ,
88- string $ tableName ,
87+ public function __construct (AuditStyle $ io ,
88+ string $ dataSchemaName ,
89+ string $ auditSchemaName ,
90+ string $ tableName ,
8991 TableColumnsMetadata $ additionalAuditColumns ,
90- ?string $ alias ,
91- ?string $ skipVariable )
92+ ?string $ alias ,
93+ ?string $ skipVariable )
9294 {
9395 $ this ->io = $ io ;
9496 $ this ->dataSchemaName = $ dataSchemaName ;
@@ -158,7 +160,7 @@ public function createAuditTable(): void
158160 /**
159161 * Creates audit triggers on this table.
160162 *
161- * @param string[] $additionalSql Additional SQL statements to be include in triggers.
163+ * @param string[] $additionalSql Additional SQL statements to be included in triggers.
162164 */
163165 public function createTriggers (array $ additionalSql ): void
164166 {
@@ -192,7 +194,7 @@ public function getTableName(): string
192194 /**
193195 * Main function for work with table.
194196 *
195- * @param string[] $additionalSql Additional SQL statements to be include in triggers.
197+ * @param string[] $additionalSql Additional SQL statements to be included in triggers.
196198 */
197199 public function main (array $ additionalSql ): void
198200 {
@@ -221,7 +223,7 @@ private function addNewColumns(TableColumnsMetadata $columns): void
221223
222224 //--------------------------------------------------------------------------------------------------------------------
223225 /**
224- * Returns metadata of new table columns that can be used in a 'alter table .. add column' statement.
226+ * Returns metadata of new table columns that can be used in a 'alter table ... add column' statement.
225227 *
226228 * @param TableColumnsMetadata $newColumns The metadata new table columns.
227229 *
@@ -243,9 +245,9 @@ private function alterNewColumns(TableColumnsMetadata $newColumns): TableColumns
243245 /**
244246 * Creates a triggers for this table.
245247 *
246- * @param string $action The trigger action (INSERT, DELETE, or UPDATE).
247- * @param string|null $skipVariable
248- * @param string[] $additionSql The additional SQL statements to be included in triggers.
248+ * @param string $action The trigger action (INSERT, DELETE, or UPDATE).
249+ * @param string|null $skipVariable The name of the MySQL user defined variable for skipping triggers.
250+ * @param string[] $additionSql The additional SQL statements to be included in triggers.
249251 */
250252 private function createTableTrigger (string $ action , ?string $ skipVariable , array $ additionSql ): void
251253 {
@@ -306,7 +308,7 @@ private function getTableColumnInfo(): array
306308 /**
307309 * Returns the trigger name for a trigger action.
308310 *
309- * @param string $action Trigger on action (Insert, Update, Delete)
311+ * @param string $action Trigger on action (Insert, Update, Delete).
310312 *
311313 * @return string
312314 */
0 commit comments