Apply fixes from StyleCI
This commit is contained in:
parent
8e157bfc12
commit
abc7bf5d3b
|
@ -28,8 +28,6 @@
|
|||
*/
|
||||
namespace Phinx\Db\Adapter;
|
||||
|
||||
use Phinx\Db\Adapter\AdapterInterface;
|
||||
|
||||
/**
|
||||
* Adapter factory and registry.
|
||||
*
|
||||
|
|
|
@ -1143,6 +1143,6 @@ class MysqlAdapter extends PdoAdapter implements AdapterInterface
|
|||
*/
|
||||
public function getColumnTypes()
|
||||
{
|
||||
return array_merge(parent::getColumnTypes(), array ('enum', 'set', 'year', 'json'));
|
||||
return array_merge(parent::getColumnTypes(), array('enum', 'set', 'year', 'json'));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,6 @@ namespace Phinx\Db\Adapter;
|
|||
|
||||
use think\console\Input as InputInterface;
|
||||
use think\console\Output as OutputInterface;
|
||||
use think\console\output\driver\Nothing as NullOutput;
|
||||
use Phinx\Db\Table;
|
||||
use Phinx\Db\Table\Column;
|
||||
use Phinx\Migration\MigrationInterface;
|
||||
|
@ -130,7 +129,7 @@ abstract class PdoAdapter implements AdapterInterface
|
|||
public function getOption($name)
|
||||
{
|
||||
if (!$this->hasOption($name)) {
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
return $this->options[$name];
|
||||
}
|
||||
|
|
|
@ -250,7 +250,6 @@ class PostgresAdapter extends PdoAdapter implements AdapterInterface
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// set the indexes
|
||||
$indexes = $table->getIndexes();
|
||||
if (!empty($indexes)) {
|
||||
|
|
|
@ -186,7 +186,6 @@ class SQLiteAdapter extends PdoAdapter implements AdapterInterface
|
|||
array_unshift($columns, $column);
|
||||
}
|
||||
|
||||
|
||||
$sql = 'CREATE TABLE ';
|
||||
$sql .= $this->quoteTableName($table->getName()) . ' (';
|
||||
foreach ($columns as $column) {
|
||||
|
@ -342,7 +341,7 @@ class SQLiteAdapter extends PdoAdapter implements AdapterInterface
|
|||
$writeColumns = array();
|
||||
foreach ($columns as $column) {
|
||||
$selectName = $column['name'];
|
||||
$writeName = ($selectName == $columnName)? $newColumnName : $selectName;
|
||||
$writeName = ($selectName == $columnName) ? $newColumnName : $selectName;
|
||||
$selectColumns[] = $this->quoteColumnName($selectName);
|
||||
$writeColumns[] = $this->quoteColumnName($writeName);
|
||||
}
|
||||
|
@ -362,7 +361,6 @@ class SQLiteAdapter extends PdoAdapter implements AdapterInterface
|
|||
);
|
||||
$this->execute($sql);
|
||||
|
||||
|
||||
$sql = sprintf(
|
||||
'INSERT INTO %s(%s) SELECT %s FROM %s',
|
||||
$tableName,
|
||||
|
@ -404,7 +402,7 @@ class SQLiteAdapter extends PdoAdapter implements AdapterInterface
|
|||
$writeColumns = array();
|
||||
foreach ($columns as $column) {
|
||||
$selectName = $column['name'];
|
||||
$writeName = ($selectName === $columnName)? $newColumn->getName() : $selectName;
|
||||
$writeName = ($selectName === $columnName) ? $newColumn->getName() : $selectName;
|
||||
$selectColumns[] = $this->quoteColumnName($selectName);
|
||||
$writeColumns[] = $this->quoteColumnName($writeName);
|
||||
}
|
||||
|
|
|
@ -120,7 +120,6 @@ class SqlServerAdapter extends PdoAdapter implements AdapterInterface
|
|||
|
||||
$driverOptions = array(\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION);
|
||||
|
||||
|
||||
try {
|
||||
$db = new \PDO($dsn, $options['user'], $options['pass'], $driverOptions);
|
||||
} catch (\PDOException $exception) {
|
||||
|
|
|
@ -88,4 +88,4 @@ abstract class Command extends \think\console\Command
|
|||
throw new InvalidArgumentException(sprintf('Migration directory "%s" is not writable', $path));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,4 +19,4 @@ class Migrator extends AbstractMigration
|
|||
{
|
||||
return new Table($tableName, $options, $this->getAdapter());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,4 +15,4 @@ use Phinx\Seed\AbstractSeed;
|
|||
class Seeder extends AbstractSeed
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -77,7 +77,6 @@ abstract class Migrate extends Command
|
|||
$this->getAdapter()
|
||||
->migrated($migration, $direction, date('Y-m-d H:i:s', $startTime), date('Y-m-d H:i:s', time()));
|
||||
|
||||
|
||||
$end = microtime(true);
|
||||
|
||||
$this->output->writeln(' ==' . ' <info>' . $migration->getVersion() . ' ' . $migration->getName() . ':</info>' . ' <comment>' . ($direction === MigrationInterface::UP ? 'migrated' : 'reverted') . ' ' . sprintf('%.4fs', $end - $start) . '</comment>');
|
||||
|
@ -144,4 +143,4 @@ abstract class Migrate extends Command
|
|||
|
||||
return $this->migrations;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,4 +69,4 @@ abstract class Seed extends Command
|
|||
|
||||
return $this->seeds;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,4 +89,4 @@ EOT
|
|||
{
|
||||
$this->output->writeln(sprintf(' %d breakpoints cleared.', $this->getAdapter()->resetAllBreakpoints()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,6 @@ EOT
|
|||
$output->writeln('<comment>All Done. Took ' . sprintf('%.4fs', $end - $start) . '</comment>');
|
||||
}
|
||||
|
||||
|
||||
public function migrateToDateTime(\DateTime $dateTime)
|
||||
{
|
||||
$versions = array_keys($this->getMigrations());
|
||||
|
|
|
@ -15,4 +15,4 @@
|
|||
"think\\migration\\command\\migrate\\Status",
|
||||
"think\\migration\\command\\seed\\Create",
|
||||
"think\\migration\\command\\seed\\Run",
|
||||
]);
|
||||
]);
|
||||
|
|
|
@ -168,4 +168,4 @@ class Column extends \Phinx\Db\Table\Column
|
|||
return self::make($name, AdapterInterface::PHINX_TYPE_UUID);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -64,4 +64,4 @@ class Table extends \Phinx\Db\Table
|
|||
}
|
||||
return parent::changeColumn($columnName, $newColumnType, $options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user