Skip to content

Commit d5e4d46

Browse files
committed
Align with coding standards.
1 parent 94bcab5 commit d5e4d46

File tree

9 files changed

+27
-19
lines changed

9 files changed

+27
-19
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
/.idea/
22
/.phpunit.result.cache
3+
/bin/jp.php
4+
/bin/pdepend
35
/bin/phing
46
/bin/php-parse
7+
/bin/phpcpd
8+
/bin/phploc
9+
/bin/phpmd
10+
/bin/phpstan
11+
/bin/phpstan.phar
512
/bin/phpunit
13+
/bin/yaml-lint
614
/composer.lock
715
/custom.task.properties
816
/custom.type.properties

src/AuditTable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public function main(array $additionalSql): void
210210
private function addNewColumns(TableColumnsMetadata $columns): void
211211
{
212212
// Return immediately if there are no columns to add.
213-
if ($columns->getNumberOfColumns()==0) return;
213+
if ($columns->getNumberOfColumns()===0) return;
214214

215215
$alterColumns = $this->alterNewColumns($columns);
216216

src/Command/BaseCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function writeTwoPhases(string $filename, string $data): void
154154
if (file_exists($filename))
155155
{
156156
$old_data = file_get_contents($filename);
157-
if ($data==$old_data) $write_flag = false;
157+
if ($data===$old_data) $write_flag = false;
158158
}
159159

160160
if ($write_flag)

src/DiffTable.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ private function getRows(bool $full): array
9090
foreach ($this->rows as $row)
9191
{
9292
// Add separator between columns and options.
93-
if ($options===false && $row['type']=='option')
93+
if ($options===false && $row['type']==='option')
9494
{
9595
if (!empty($ret)) $ret[] = new TableSeparator();
9696
$options = true;
@@ -100,7 +100,7 @@ private function getRows(bool $full): array
100100
{
101101
$ret[] = [$row['name'], $row['audit1'], $row['data1']];
102102

103-
if ($row['rowspan']==2)
103+
if ($row['rowspan']===2)
104104
{
105105
$ret[] = ['', $row['audit2'], $row['data2']];
106106
}
@@ -134,7 +134,7 @@ private function rowsEnhanceWithColumnTypeInfo(): void
134134
{
135135
foreach ($this->rows as &$row)
136136
{
137-
if ($row['type']=='column')
137+
if ($row['type']==='column')
138138
{
139139
if ($row['data']!==null)
140140
{
@@ -175,11 +175,11 @@ private function rowsEnhanceWithDiffIndicator(): void
175175
{
176176
case 'column':
177177
$row['diff'] = (isset($row['audit'])!==isset($row['data']) ||
178-
$row['audit']->getColumnDefinition()!=$row['data']->getColumnDefinition());
178+
$row['audit']->getColumnDefinition()!==$row['data']->getColumnDefinition());
179179
break;
180180

181181
case 'option':
182-
$row['diff'] = ($row['audit1']!=$row['data1']);
182+
$row['diff'] = ($row['audit1']!==$row['data1']);
183183
break;
184184

185185
default:
@@ -201,13 +201,13 @@ private function rowsEnhanceWithFormatting(): void
201201
$row['name'] = sprintf('<mm_column>%s</mm_column>', $row['name']);
202202
}
203203

204-
if ($row['audit1']!=$row['data1'])
204+
if ($row['audit1']!==$row['data1'])
205205
{
206206
$row['audit1'] = sprintf('<mm_type>%s</mm_type>', $row['audit1']);
207207
$row['data1'] = sprintf('<mm_type>%s</mm_type>', $row['data1']);
208208
}
209209

210-
if ($row['rowspan']==2 && ($row['audit2']!=$row['data2']))
210+
if ($row['rowspan']===2 && ($row['audit2']!==$row['data2']))
211211
{
212212
$row['audit2'] = sprintf('<mm_type>%s</mm_type>', $row['audit2']);
213213
$row['data2'] = sprintf('<mm_type>%s</mm_type>', $row['data2']);

src/Metadata/ColumnMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static function compare(ColumnMetadata $column1, ColumnMetadata $column2,
6363
{
6464
if (!in_array($field, $ignore))
6565
{
66-
if ($column1->getProperty($field)!=$column2->getProperty($field))
66+
if ($column1->getProperty($field)!==$column2->getProperty($field))
6767
{
6868
$equal = false;
6969
}

src/Metadata/TableMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public static function compareOptions(TableMetadata $table1, TableMetadata $tabl
6767
{
6868
if (!in_array($field, ['table_schema', 'table_name']))
6969
{
70-
if ($table1->getProperty($field)!=$table2->getProperty($field))
70+
if ($table1->getProperty($field)!==$table2->getProperty($field))
7171
{
7272
$diff[] = $field;
7373
}

src/MySql/AlterTableCodeStore.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ protected function indentationMode(string $line): int
2020

2121
$line = trim($line);
2222

23-
if (substr($line, 0, 11)=='alter table' && substr($line, -1)<>';')
23+
if (substr($line, 0, 11)==='alter table' && substr($line, -1)<>';')
2424
{
2525
$mode |= self::C_INDENT_INCREMENT_AFTER;
2626
}
2727

28-
if (substr($line, 0, 1)==';')
28+
if (substr($line, 0, 1)===';')
2929
{
3030
$mode |= self::C_INDENT_DECREMENT_BEFORE;
3131
}

src/MySql/Metadata/ColumnMetadata.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@ public function getColumnAuditDefinition(): string
4545
$parts[] = 'collate '.$this->getProperty('collation_name');
4646
}
4747

48-
$parts[] = ($this->getProperty('is_nullable')=='YES') ? 'null' : 'not null';
48+
$parts[] = ($this->getProperty('is_nullable')==='YES') ? 'null' : 'not null';
4949

50-
if ($this->getProperty('column_default')!==null && mb_strtoupper($this->getProperty('column_default'))!=='NULL')
50+
if ($this->getProperty('column_default')!==null && $this->getProperty('column_default')!=='NULL')
5151
{
5252
$parts[] = 'default '.$this->getProperty('column_default');
5353
}
@@ -83,9 +83,9 @@ public function getColumnDefinition(): string
8383
$parts[] = 'collate '.$this->getProperty('collation_name');
8484
}
8585

86-
$parts[] = ($this->getProperty('is_nullable')=='YES') ? 'null' : 'not null';
86+
$parts[] = ($this->getProperty('is_nullable')==='YES') ? 'null' : 'not null';
8787

88-
if ($this->getProperty('column_default')!==null && $this->getProperty('column_default')!='NULL')
88+
if ($this->getProperty('column_default')!==null && $this->getProperty('column_default')!=='NULL')
8989
{
9090
$parts[] = 'default '.$this->getProperty('column_default');
9191
}
@@ -99,7 +99,7 @@ public function getColumnDefinition(): string
9999
*/
100100
public function getTypeInfo1(): string
101101
{
102-
if ($this->getProperty('is_nullable')=='YES')
102+
if ($this->getProperty('is_nullable')==='YES')
103103
{
104104
return $this->getProperty('column_type');
105105
}

src/MySql/Sql/CreateAuditTrigger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ public function buildStatement(): string
165165
$this->code->append($this->additionalSql);
166166

167167
$this->createInsertStatement($rowState[0]);
168-
if (count($rowState)==2)
168+
if (count($rowState)===2)
169169
{
170170
$this->createInsertStatement($rowState[1]);
171171
}

0 commit comments

Comments
 (0)