Replace $thingyName arguments with $name where "thingy" is clear from the context

parent c890d041
...@@ -192,15 +192,15 @@ abstract class AbstractSchemaManager ...@@ -192,15 +192,15 @@ abstract class AbstractSchemaManager
* *
* The usage of a string $tableNames is deprecated. Pass a one-element array instead. * The usage of a string $tableNames is deprecated. Pass a one-element array instead.
* *
* @param string|string[] $tableNames * @param string|string[] $names
* *
* @return bool * @return bool
*/ */
public function tablesExist($tableNames) public function tablesExist($names)
{ {
$tableNames = array_map('strtolower', (array) $tableNames); $names = array_map('strtolower', (array) $names);
return count($tableNames) === count(array_intersect($tableNames, array_map('strtolower', $this->listTableNames()))); return count($names) === count(array_intersect($names, array_map('strtolower', $this->listTableNames())));
} }
/** /**
...@@ -264,21 +264,21 @@ abstract class AbstractSchemaManager ...@@ -264,21 +264,21 @@ abstract class AbstractSchemaManager
} }
/** /**
* @param string $tableName * @param string $name
* *
* @return Table * @return Table
*/ */
public function listTableDetails($tableName) public function listTableDetails($name)
{ {
$columns = $this->listTableColumns($tableName); $columns = $this->listTableColumns($name);
$foreignKeys = []; $foreignKeys = [];
if ($this->_platform->supportsForeignKeyConstraints()) { if ($this->_platform->supportsForeignKeyConstraints()) {
$foreignKeys = $this->listTableForeignKeys($tableName); $foreignKeys = $this->listTableForeignKeys($name);
} }
$indexes = $this->listTableIndexes($tableName); $indexes = $this->listTableIndexes($name);
return new Table($tableName, $columns, $indexes, $foreignKeys); return new Table($name, $columns, $indexes, $foreignKeys);
} }
/** /**
...@@ -334,13 +334,13 @@ abstract class AbstractSchemaManager ...@@ -334,13 +334,13 @@ abstract class AbstractSchemaManager
/** /**
* Drops the given table. * Drops the given table.
* *
* @param string $tableName The name of the table to drop. * @param string $name The name of the table to drop.
* *
* @return void * @return void
*/ */
public function dropTable($tableName) public function dropTable($name)
{ {
$this->_execSql($this->_platform->getDropTableSQL($tableName)); $this->_execSql($this->_platform->getDropTableSQL($name));
} }
/** /**
......
...@@ -59,12 +59,12 @@ class Column extends AbstractAsset ...@@ -59,12 +59,12 @@ class Column extends AbstractAsset
/** /**
* Creates a new Column. * Creates a new Column.
* *
* @param string $columnName * @param string $name
* @param mixed[] $options * @param mixed[] $options
*/ */
public function __construct($columnName, Type $type, array $options = []) public function __construct($name, Type $type, array $options = [])
{ {
$this->_setName($columnName); $this->_setName($name);
$this->setType($type); $this->setType($type);
$this->setOptions($options); $this->setOptions($options);
} }
......
...@@ -222,13 +222,13 @@ class DB2SchemaManager extends AbstractSchemaManager ...@@ -222,13 +222,13 @@ class DB2SchemaManager extends AbstractSchemaManager
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function listTableDetails($tableName): Table public function listTableDetails($name): Table
{ {
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($name);
$platform = $this->_platform; $platform = $this->_platform;
assert($platform instanceof DB2Platform); assert($platform instanceof DB2Platform);
$sql = $platform->getListTableCommentsSQL($tableName); $sql = $platform->getListTableCommentsSQL($name);
$tableOptions = $this->_conn->fetchAssoc($sql); $tableOptions = $this->_conn->fetchAssoc($sql);
......
...@@ -47,18 +47,18 @@ class Index extends AbstractAsset implements Constraint ...@@ -47,18 +47,18 @@ class Index extends AbstractAsset implements Constraint
private $options = []; private $options = [];
/** /**
* @param string $indexName * @param string $name
* @param string[] $columns * @param string[] $columns
* @param bool $isUnique * @param bool $isUnique
* @param bool $isPrimary * @param bool $isPrimary
* @param string[] $flags * @param string[] $flags
* @param mixed[] $options * @param mixed[] $options
*/ */
public function __construct($indexName, array $columns, $isUnique = false, $isPrimary = false, array $flags = [], array $options = []) public function __construct($name, array $columns, $isUnique = false, $isPrimary = false, array $flags = [], array $options = [])
{ {
$isUnique = $isUnique || $isPrimary; $isUnique = $isUnique || $isPrimary;
$this->_setName($indexName); $this->_setName($name);
$this->_isUnique = $isUnique; $this->_isUnique = $isUnique;
$this->_isPrimary = $isPrimary; $this->_isPrimary = $isPrimary;
$this->options = $options; $this->options = $options;
...@@ -156,17 +156,17 @@ class Index extends AbstractAsset implements Constraint ...@@ -156,17 +156,17 @@ class Index extends AbstractAsset implements Constraint
} }
/** /**
* @param string $columnName * @param string $name
* @param int $pos * @param int $pos
* *
* @return bool * @return bool
*/ */
public function hasColumnAtPosition($columnName, $pos = 0) public function hasColumnAtPosition($name, $pos = 0)
{ {
$columnName = $this->trimQuotes(strtolower($columnName)); $name = $this->trimQuotes(strtolower($name));
$indexColumns = array_map('strtolower', $this->getUnquotedColumns()); $indexColumns = array_map('strtolower', $this->getUnquotedColumns());
return array_search($columnName, $indexColumns) === $pos; return array_search($name, $indexColumns) === $pos;
} }
/** /**
......
...@@ -320,13 +320,13 @@ class MySqlSchemaManager extends AbstractSchemaManager ...@@ -320,13 +320,13 @@ class MySqlSchemaManager extends AbstractSchemaManager
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function listTableDetails($tableName) public function listTableDetails($name)
{ {
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($name);
$platform = $this->_platform; $platform = $this->_platform;
assert($platform instanceof MySqlPlatform); assert($platform instanceof MySqlPlatform);
$sql = $platform->getListTableMetadataSQL($tableName); $sql = $platform->getListTableMetadataSQL($name);
$tableOptions = $this->_conn->fetchAssoc($sql); $tableOptions = $this->_conn->fetchAssoc($sql);
......
...@@ -400,13 +400,13 @@ SQL; ...@@ -400,13 +400,13 @@ SQL;
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function listTableDetails($tableName): Table public function listTableDetails($name): Table
{ {
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($name);
$platform = $this->_platform; $platform = $this->_platform;
assert($platform instanceof OraclePlatform); assert($platform instanceof OraclePlatform);
$sql = $platform->getListTableCommentsSQL($tableName); $sql = $platform->getListTableCommentsSQL($name);
$tableOptions = $this->_conn->fetchAssoc($sql); $tableOptions = $this->_conn->fetchAssoc($sql);
......
...@@ -506,13 +506,13 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -506,13 +506,13 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function listTableDetails($tableName): Table public function listTableDetails($name): Table
{ {
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($name);
$platform = $this->_platform; $platform = $this->_platform;
assert($platform instanceof PostgreSqlPlatform); assert($platform instanceof PostgreSqlPlatform);
$sql = $platform->getListTableMetadataSQL($tableName); $sql = $platform->getListTableMetadataSQL($name);
$tableOptions = $this->_conn->fetchAssoc($sql); $tableOptions = $this->_conn->fetchAssoc($sql);
......
...@@ -331,15 +331,15 @@ class SQLServerSchemaManager extends AbstractSchemaManager ...@@ -331,15 +331,15 @@ class SQLServerSchemaManager extends AbstractSchemaManager
} }
/** /**
* @param string $tableName * @param string $name
*/ */
public function listTableDetails($tableName): Table public function listTableDetails($name): Table
{ {
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($name);
$platform = $this->_platform; $platform = $this->_platform;
assert($platform instanceof SQLServerPlatform); assert($platform instanceof SQLServerPlatform);
$sql = $platform->getListTableMetadataSQL($tableName); $sql = $platform->getListTableMetadataSQL($name);
$tableOptions = $this->_conn->fetchAssoc($sql); $tableOptions = $this->_conn->fetchAssoc($sql);
......
...@@ -165,20 +165,20 @@ class Schema extends AbstractAsset ...@@ -165,20 +165,20 @@ class Schema extends AbstractAsset
} }
/** /**
* @param string $tableName * @param string $name
* *
* @return Table * @return Table
* *
* @throws SchemaException * @throws SchemaException
*/ */
public function getTable($tableName) public function getTable($name)
{ {
$tableName = $this->getFullQualifiedAssetName($tableName); $name = $this->getFullQualifiedAssetName($name);
if (! isset($this->_tables[$tableName])) { if (! isset($this->_tables[$name])) {
throw SchemaException::tableDoesNotExist($tableName); throw SchemaException::tableDoesNotExist($name);
} }
return $this->_tables[$tableName]; return $this->_tables[$name];
} }
/** /**
...@@ -216,29 +216,29 @@ class Schema extends AbstractAsset ...@@ -216,29 +216,29 @@ class Schema extends AbstractAsset
/** /**
* Does this schema have a namespace with the given name? * Does this schema have a namespace with the given name?
* *
* @param string $namespaceName * @param string $name
* *
* @return bool * @return bool
*/ */
public function hasNamespace($namespaceName) public function hasNamespace($name)
{ {
$namespaceName = strtolower($this->getUnquotedAssetName($namespaceName)); $name = strtolower($this->getUnquotedAssetName($name));
return isset($this->namespaces[$namespaceName]); return isset($this->namespaces[$name]);
} }
/** /**
* Does this schema have a table with the given name? * Does this schema have a table with the given name?
* *
* @param string $tableName * @param string $name
* *
* @return bool * @return bool
*/ */
public function hasTable($tableName) public function hasTable($name)
{ {
$tableName = $this->getFullQualifiedAssetName($tableName); $name = $this->getFullQualifiedAssetName($name);
return isset($this->_tables[$tableName]); return isset($this->_tables[$name]);
} }
/** /**
...@@ -291,21 +291,21 @@ class Schema extends AbstractAsset ...@@ -291,21 +291,21 @@ class Schema extends AbstractAsset
/** /**
* Creates a new namespace. * Creates a new namespace.
* *
* @param string $namespaceName The name of the namespace to create. * @param string $name The name of the namespace to create.
* *
* @return Schema This schema instance. * @return Schema This schema instance.
* *
* @throws SchemaException * @throws SchemaException
*/ */
public function createNamespace($namespaceName) public function createNamespace($name)
{ {
$unquotedNamespaceName = strtolower($this->getUnquotedAssetName($namespaceName)); $unquotedName = strtolower($this->getUnquotedAssetName($name));
if (isset($this->namespaces[$unquotedNamespaceName])) { if (isset($this->namespaces[$unquotedName])) {
throw SchemaException::namespaceAlreadyExists($unquotedNamespaceName); throw SchemaException::namespaceAlreadyExists($unquotedName);
} }
$this->namespaces[$unquotedNamespaceName] = $namespaceName; $this->namespaces[$unquotedName] = $name;
return $this; return $this;
} }
...@@ -313,17 +313,17 @@ class Schema extends AbstractAsset ...@@ -313,17 +313,17 @@ class Schema extends AbstractAsset
/** /**
* Creates a new table. * Creates a new table.
* *
* @param string $tableName * @param string $name
* *
* @return Table * @return Table
*/ */
public function createTable($tableName) public function createTable($name)
{ {
$table = new Table($tableName); $table = new Table($name);
$this->_addTable($table); $this->_addTable($table);
foreach ($this->_schemaConfig->getDefaultTableOptions() as $name => $value) { foreach ($this->_schemaConfig->getDefaultTableOptions() as $option => $value) {
$table->addOption($name, $value); $table->addOption($option, $value);
} }
return $table; return $table;
...@@ -332,17 +332,17 @@ class Schema extends AbstractAsset ...@@ -332,17 +332,17 @@ class Schema extends AbstractAsset
/** /**
* Renames a table. * Renames a table.
* *
* @param string $oldTableName * @param string $oldName
* @param string $newTableName * @param string $newName
* *
* @return Schema * @return Schema
*/ */
public function renameTable($oldTableName, $newTableName) public function renameTable($oldName, $newName)
{ {
$table = $this->getTable($oldTableName); $table = $this->getTable($oldName);
$table->_setName($newTableName); $table->_setName($newName);
$this->dropTable($oldTableName); $this->dropTable($oldName);
$this->_addTable($table); $this->_addTable($table);
return $this; return $this;
...@@ -351,15 +351,15 @@ class Schema extends AbstractAsset ...@@ -351,15 +351,15 @@ class Schema extends AbstractAsset
/** /**
* Drops a table from the schema. * Drops a table from the schema.
* *
* @param string $tableName * @param string $name
* *
* @return Schema * @return Schema
*/ */
public function dropTable($tableName) public function dropTable($name)
{ {
$tableName = $this->getFullQualifiedAssetName($tableName); $name = $this->getFullQualifiedAssetName($name);
$this->getTable($tableName); $this->getTable($name);
unset($this->_tables[$tableName]); unset($this->_tables[$name]);
return $this; return $this;
} }
......
...@@ -537,15 +537,15 @@ SQL ...@@ -537,15 +537,15 @@ SQL
} }
/** /**
* @param string $tableName * @param string $name
*/ */
public function listTableDetails($tableName): Table public function listTableDetails($name): Table
{ {
$table = parent::listTableDetails($tableName); $table = parent::listTableDetails($name);
$tableCreateSql = $this->getCreateTableSQL($tableName) ?? ''; $tableCreateSql = $this->getCreateTableSQL($name) ?? '';
$comment = $this->parseTableCommentFromSQL($tableName, $tableCreateSql); $comment = $this->parseTableCommentFromSQL($name, $tableCreateSql);
if ($comment !== null) { if ($comment !== null) {
$table->addOption('comment', $comment); $table->addOption('comment', $comment);
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment