Skip to content

Commit 448130e

Browse files
committed
Align with coding standards.
1 parent 4610af5 commit 448130e

File tree

5 files changed

+34
-11
lines changed

5 files changed

+34
-11
lines changed

src/Audit/AlterAuditTable.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,10 @@ private function compareTableColumns(TableMetadata $dataTable, TableMetadata $au
114114
$name = $column->getName();
115115
$filler = str_repeat(' ', $maxLength - mb_strlen($name) + 1);
116116

117-
if (!$first) $this->codeStore->appendToLastLine(',');
117+
if (!$first)
118+
{
119+
$this->codeStore->appendToLastLine(',');
120+
}
118121

119122
$this->codeStore->append(sprintf('change column `%s`%s`%s`%s%s',
120123
$name,

src/Audit/Diff.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ class Diff
4545
*
4646
* @var AuditStyle
4747
*/
48-
private $io;
48+
private AuditStyle $io;
4949

5050
/**
5151
* The Output interface.
5252
*
5353
* @var OutputInterface
5454
*/
55-
private $output;
55+
private OutputInterface $output;
5656

5757
//--------------------------------------------------------------------------------------------------------------------
5858
/**

src/Metadata/ColumnMetadata.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,10 @@ public function setAfter(?string $after): void
166166
*/
167167
public function unsetDefault(): void
168168
{
169-
if (isset($this->properties['column_default'])) $this->properties['column_default'] = 'NULL';
169+
if (isset($this->properties['column_default']))
170+
{
171+
$this->properties['column_default'] = 'NULL';
172+
}
170173
}
171174

172175
//--------------------------------------------------------------------------------------------------------------------

src/Metadata/TableColumnsMetadata.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ class TableColumnsMetadata
2222
private array $columns = [];
2323

2424
//--------------------------------------------------------------------------------------------------------------------
25-
2625
/**
2726
* Object constructor.
2827
*

src/MySql/Sql/CreateAuditTrigger.php

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,10 @@ public function buildStatement(): string
160160
$this->code->append('for each row');
161161
$this->code->append('begin');
162162

163-
if ($this->skipVariable!==null) $this->code->append(sprintf('if (%s is null) then', $this->skipVariable));
163+
if ($this->skipVariable!==null)
164+
{
165+
$this->code->append(sprintf('if (%s is null) then', $this->skipVariable));
166+
}
164167

165168
$this->code->append($this->additionalSql);
166169

@@ -170,7 +173,10 @@ public function buildStatement(): string
170173
$this->createInsertStatement($rowState[1]);
171174
}
172175

173-
if ($this->skipVariable!==null) $this->code->append('end if;');
176+
if ($this->skipVariable!==null)
177+
{
178+
$this->code->append('end if;');
179+
}
174180
$this->code->append('end');
175181

176182
return $this->code->getCode();
@@ -199,14 +205,20 @@ private function createInsertStatementInto(): void
199205
// First the audit columns.
200206
foreach ($this->additionalAuditColumns->getColumns() as $column)
201207
{
202-
if ($columnNames) $columnNames .= ',';
208+
if ($columnNames!=='')
209+
{
210+
$columnNames .= ',';
211+
}
203212
$columnNames .= sprintf('`%s`', $column->getName());
204213
}
205214

206215
// Second the audit columns.
207216
foreach ($this->tableColumns->getColumns() as $column)
208217
{
209-
if ($columnNames) $columnNames .= ',';
218+
if ($columnNames!=='')
219+
{
220+
$columnNames .= ',';
221+
}
210222
$columnNames .= sprintf('`%s`', $column->getName());
211223
}
212224

@@ -227,7 +239,10 @@ private function createInsertStatementValues(string $rowState): void
227239
foreach ($this->additionalAuditColumns->getColumns() as $column)
228240
{
229241
$column = $column->getProperties();
230-
if ($values) $values .= ',';
242+
if ($values!=='')
243+
{
244+
$values .= ',';
245+
}
231246

232247
switch (true)
233248
{
@@ -259,7 +274,10 @@ private function createInsertStatementValues(string $rowState): void
259274
// Second the values for the audit columns.
260275
foreach ($this->tableColumns->getColumns() as $column)
261276
{
262-
if ($values) $values .= ',';
277+
if ($values!=='')
278+
{
279+
$values .= ',';
280+
}
263281
$values .= sprintf('%s.`%s`', $rowState, $column->getName());
264282
}
265283

0 commit comments

Comments
 (0)