Apply fixes from StyleCI

This commit is contained in:
ThinkPHP 2016-12-26 05:34:15 +00:00 committed by StyleCI Bot
parent 8e157bfc12
commit abc7bf5d3b
16 changed files with 13 additions and 22 deletions

View File

@ -28,8 +28,6 @@
*/
namespace Phinx\Db\Adapter;
use Phinx\Db\Adapter\AdapterInterface;
/**
* Adapter factory and registry.
*

View File

@ -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'));
}
}

View File

@ -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];
}

View File

@ -250,7 +250,6 @@ class PostgresAdapter extends PdoAdapter implements AdapterInterface
}
}
// set the indexes
$indexes = $table->getIndexes();
if (!empty($indexes)) {

View File

@ -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);
}

View File

@ -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) {

View File

@ -88,4 +88,4 @@ abstract class Command extends \think\console\Command
throw new InvalidArgumentException(sprintf('Migration directory "%s" is not writable', $path));
}
}
}
}

View File

@ -19,4 +19,4 @@ class Migrator extends AbstractMigration
{
return new Table($tableName, $options, $this->getAdapter());
}
}
}

View File

@ -15,4 +15,4 @@ use Phinx\Seed\AbstractSeed;
class Seeder extends AbstractSeed
{
}
}

View File

@ -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;
}
}
}

View File

@ -69,4 +69,4 @@ abstract class Seed extends Command
return $this->seeds;
}
}
}

View File

@ -89,4 +89,4 @@ EOT
{
$this->output->writeln(sprintf(' %d breakpoints cleared.', $this->getAdapter()->resetAllBreakpoints()));
}
}
}

View File

@ -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());

View File

@ -15,4 +15,4 @@
"think\\migration\\command\\migrate\\Status",
"think\\migration\\command\\seed\\Create",
"think\\migration\\command\\seed\\Run",
]);
]);

View File

@ -168,4 +168,4 @@ class Column extends \Phinx\Db\Table\Column
return self::make($name, AdapterInterface::PHINX_TYPE_UUID);
}
}
}

View File

@ -64,4 +64,4 @@ class Table extends \Phinx\Db\Table
}
return parent::changeColumn($columnName, $newColumnType, $options);
}
}
}