Skip to content

Commit 1c9bcfc

Browse files
author
Carlos Cima
committed
Fixed code style with php-cs-fixer.
1 parent 3fbe9a1 commit 1c9bcfc

File tree

14 files changed

+43
-59
lines changed

14 files changed

+43
-59
lines changed

src/Command/AbstractCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
use Symfony\Component\Console\Output\OutputInterface;
77

88
/**
9-
* Class AbstractCommand
10-
*
11-
* @package Camcima\MySqlDiff\Command
9+
* Class AbstractCommand.
1210
*/
1311
abstract class AbstractCommand extends Command
1412
{

src/Command/DiffCommand.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
use Symfony\Component\Console\Output\OutputInterface;
1111

1212
/**
13-
* Class DiffCommand
14-
*
15-
* @package Camcima\MySqlDiff\Command
13+
* Class DiffCommand.
1614
*/
1715
class DiffCommand extends AbstractCommand
1816
{
@@ -43,6 +41,7 @@ protected function configure()
4341
/**
4442
* @param InputInterface $input
4543
* @param OutputInterface $output
44+
*
4645
* @return int|null|void
4746
*/
4847
protected function execute(InputInterface $input, OutputInterface $output)

src/Command/MigrateCommand.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@
1010
use Symfony\Component\Console\Output\OutputInterface;
1111

1212
/**
13-
* Class MigrateCommand
14-
*
15-
* @package Camcima\MySqlDiff\Command
13+
* Class MigrateCommand.
1614
*/
1715
class MigrateCommand extends AbstractCommand
1816
{
@@ -55,6 +53,7 @@ protected function configure()
5553
/**
5654
* @param InputInterface $input
5755
* @param OutputInterface $output
56+
*
5857
* @return int|null|void
5958
*/
6059
protected function execute(InputInterface $input, OutputInterface $output)

src/Differ.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
use Camcima\MySqlDiff\Model\DatabaseDiff;
99

1010
/**
11-
* Class Differ
12-
*
13-
* @package Camcima\MySqlDiff
11+
* Class Differ.
1412
*/
1513
class Differ
1614
{
@@ -26,7 +24,6 @@ public function diffDatabases(Database $fromDatabase, Database $toDatabase, arra
2624
$databaseDiff = new DatabaseDiff();
2725

2826
foreach ($fromDatabase->getTables() as $fromTable) {
29-
3027
if ($this->isTableIgnored($fromTable->getName(), $ignoreList)) {
3128
continue;
3229
}
@@ -46,7 +43,6 @@ public function diffDatabases(Database $fromDatabase, Database $toDatabase, arra
4643
}
4744

4845
foreach ($toDatabase->getTables() as $toTable) {
49-
5046
if ($this->isTableIgnored($toTable->getName(), $ignoreList)) {
5147
continue;
5248
}
@@ -230,7 +226,7 @@ public function generateMigrationScript(DatabaseDiff $databaseDiff, $displayProg
230226
*/
231227
public function generateMigrationScriptArray(DatabaseDiff $databaseDiff, $displayProgress = false)
232228
{
233-
$migrationScript = array();
229+
$migrationScript = [];
234230
$migrationScript[] = '# Disable Foreign Keys Check';
235231
$migrationScript[] = 'SET FOREIGN_KEY_CHECKS = 0;';
236232
$migrationScript[] = 'SET SQL_MODE = \'\';';
@@ -242,7 +238,6 @@ public function generateMigrationScriptArray(DatabaseDiff $databaseDiff, $displa
242238
$migrationScript[] = sprintf('-- deleted table `%s`', $deletedTable->getName());
243239
$migrationScript[] = '';
244240

245-
246241
if ($displayProgress) {
247242
$migrationScript[] = sprintf("SELECT 'Dropping table %s';", $deletedTable->getName());
248243
}

src/Model/ChangedTable.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace Camcima\MySqlDiff\Model;
44

55
/**
6-
* Class ChangedTable
7-
*
8-
* @package Camcima\MySqlDiff\Model
6+
* Class ChangedTable.
97
*/
108
class ChangedTable
119
{
@@ -389,7 +387,7 @@ public function generateAlterScript()
389387
}
390388

391389
if ($this->fromTable->getComment() !== $this->toTable->getComment()) {
392-
$tableChanges[] = sprintf('COMMENT=\'%s\'', str_replace('\'','\'\'', $this->toTable->getComment()));
390+
$tableChanges[] = sprintf('COMMENT=\'%s\'', str_replace('\'', '\'\'', $this->toTable->getComment()));
393391
}
394392

395393
$alterScript = sprintf('ALTER TABLE `%s`%s %s;', $this->getName(), PHP_EOL, implode(',' . PHP_EOL . ' ', $tableChanges));

src/Model/Column.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace Camcima\MySqlDiff\Model;
44

55
/**
6-
* Class Column
7-
*
8-
* @package Camcima\MySqlDiff\Model
6+
* Class Column.
97
*/
108
class Column
119
{
@@ -442,7 +440,7 @@ public function generateCreationScript()
442440
}
443441

444442
if (!empty($this->comment)) {
445-
$columnOptions[] = sprintf('COMMENT \'%s\'', str_replace('\'','\'\'', $this->comment));
443+
$columnOptions[] = sprintf('COMMENT \'%s\'', str_replace('\'', '\'\'', $this->comment));
446444
}
447445

448446
return trim(sprintf('`%s` %s %s', $this->name, $this->columnType, implode(' ', $columnOptions)));

src/Model/Database.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace Camcima\MySqlDiff\Model;
44

55
/**
6-
* Class Database
7-
*
8-
* @package Camcima\MySqlDiff\Model
6+
* Class Database.
97
*/
108
class Database
119
{
@@ -32,8 +30,10 @@ public function addTable(Table $table)
3230

3331
/**
3432
* @param string $tableName
35-
* @return Table
33+
*
3634
* @throws \RuntimeException
35+
*
36+
* @return Table
3737
*/
3838
public function getTableByName($tableName)
3939
{

src/Model/DatabaseDiff.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace Camcima\MySqlDiff\Model;
44

55
/**
6-
* Class DatabaseDiff
7-
*
8-
* @package Camcima\MySqlDiff\Model
6+
* Class DatabaseDiff.
97
*/
108
class DatabaseDiff
119
{

src/Model/ForeignKey.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace Camcima\MySqlDiff\Model;
44

55
/**
6-
* Class ForeignKey
7-
*
8-
* @package Camcima\MySqlDiff\Model
6+
* Class ForeignKey.
97
*/
108
class ForeignKey
119
{

src/Model/Index.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
namespace Camcima\MySqlDiff\Model;
44

55
/**
6-
* Class Index
7-
*
8-
* @package Camcima\MySqlDiff\Model
6+
* Class Index.
97
*/
108
class Index
119
{
@@ -102,8 +100,10 @@ public function addIndexColumn(IndexColumn $indexColumn)
102100

103101
/**
104102
* @param $columnName
105-
* @return IndexColumn
103+
*
106104
* @throws \RuntimeException
105+
*
106+
* @return IndexColumn
107107
*/
108108
public function getIndexColumnByColumnName($columnName)
109109
{

0 commit comments

Comments
 (0)