From 1a0226d2c7fbc7d15aae37c0905a944ad5255363 Mon Sep 17 00:00:00 2001 From: Sergei Morozov Date: Fri, 17 Jul 2020 15:54:18 -0700 Subject: [PATCH] Replace $thingyName arguments with $name where "thingy" is clear from the context --- .../DBAL/Schema/AbstractSchemaManager.php | 26 +-- lib/Doctrine/DBAL/Schema/Column.php | 6 +- lib/Doctrine/DBAL/Schema/DB2SchemaManager.php | 6 +- lib/Doctrine/DBAL/Schema/Index.php | 14 +- .../DBAL/Schema/MySqlSchemaManager.php | 6 +- .../DBAL/Schema/OracleSchemaManager.php | 6 +- .../DBAL/Schema/PostgreSqlSchemaManager.php | 6 +- .../DBAL/Schema/SQLServerSchemaManager.php | 8 +- lib/Doctrine/DBAL/Schema/Schema.php | 72 ++++----- .../DBAL/Schema/SqliteSchemaManager.php | 10 +- lib/Doctrine/DBAL/Schema/Table.php | 150 +++++++++--------- 11 files changed, 155 insertions(+), 155 deletions(-) diff --git a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php index 1cb7e66f5be..f4c0474a0c2 100644 --- a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php @@ -192,15 +192,15 @@ public function listTableIndexes($table) * * The usage of a string $tableNames is deprecated. Pass a one-element array instead. * - * @param string|string[] $tableNames + * @param string|string[] $names * * @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 @@ public function listTables() } /** - * @param string $tableName + * @param string $name * * @return Table */ - public function listTableDetails($tableName) + public function listTableDetails($name) { - $columns = $this->listTableColumns($tableName); + $columns = $this->listTableColumns($name); $foreignKeys = []; 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 @@ public function dropDatabase($database) /** * 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 */ - public function dropTable($tableName) + public function dropTable($name) { - $this->_execSql($this->_platform->getDropTableSQL($tableName)); + $this->_execSql($this->_platform->getDropTableSQL($name)); } /** diff --git a/lib/Doctrine/DBAL/Schema/Column.php b/lib/Doctrine/DBAL/Schema/Column.php index be9399a3b07..e33f285108b 100644 --- a/lib/Doctrine/DBAL/Schema/Column.php +++ b/lib/Doctrine/DBAL/Schema/Column.php @@ -59,12 +59,12 @@ class Column extends AbstractAsset /** * Creates a new Column. * - * @param string $columnName + * @param string $name * @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->setOptions($options); } diff --git a/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php b/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php index 1559fa135fe..bb106f01657 100644 --- a/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/DB2SchemaManager.php @@ -222,13 +222,13 @@ protected function _getPortableViewDefinition($view) /** * {@inheritdoc} */ - public function listTableDetails($tableName): Table + public function listTableDetails($name): Table { - $table = parent::listTableDetails($tableName); + $table = parent::listTableDetails($name); $platform = $this->_platform; assert($platform instanceof DB2Platform); - $sql = $platform->getListTableCommentsSQL($tableName); + $sql = $platform->getListTableCommentsSQL($name); $tableOptions = $this->_conn->fetchAssoc($sql); diff --git a/lib/Doctrine/DBAL/Schema/Index.php b/lib/Doctrine/DBAL/Schema/Index.php index 81299353011..266357e4a63 100644 --- a/lib/Doctrine/DBAL/Schema/Index.php +++ b/lib/Doctrine/DBAL/Schema/Index.php @@ -47,18 +47,18 @@ class Index extends AbstractAsset implements Constraint private $options = []; /** - * @param string $indexName + * @param string $name * @param string[] $columns * @param bool $isUnique * @param bool $isPrimary * @param string[] $flags * @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; - $this->_setName($indexName); + $this->_setName($name); $this->_isUnique = $isUnique; $this->_isPrimary = $isPrimary; $this->options = $options; @@ -156,17 +156,17 @@ public function isPrimary() } /** - * @param string $columnName + * @param string $name * @param int $pos * * @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()); - return array_search($columnName, $indexColumns) === $pos; + return array_search($name, $indexColumns) === $pos; } /** diff --git a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php index 2e37d56be8f..edcba52c3a3 100644 --- a/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/MySqlSchemaManager.php @@ -320,13 +320,13 @@ protected function _getPortableTableForeignKeysList($tableForeignKeys) /** * {@inheritdoc} */ - public function listTableDetails($tableName) + public function listTableDetails($name) { - $table = parent::listTableDetails($tableName); + $table = parent::listTableDetails($name); $platform = $this->_platform; assert($platform instanceof MySqlPlatform); - $sql = $platform->getListTableMetadataSQL($tableName); + $sql = $platform->getListTableMetadataSQL($name); $tableOptions = $this->_conn->fetchAssoc($sql); diff --git a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php index d3eb7ba686a..997d3937be7 100644 --- a/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/OracleSchemaManager.php @@ -400,13 +400,13 @@ private function killUserSessions($user) /** * {@inheritdoc} */ - public function listTableDetails($tableName): Table + public function listTableDetails($name): Table { - $table = parent::listTableDetails($tableName); + $table = parent::listTableDetails($name); $platform = $this->_platform; assert($platform instanceof OraclePlatform); - $sql = $platform->getListTableCommentsSQL($tableName); + $sql = $platform->getListTableCommentsSQL($name); $tableOptions = $this->_conn->fetchAssoc($sql); diff --git a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php index 059a3398590..57e9b147337 100644 --- a/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/PostgreSqlSchemaManager.php @@ -506,13 +506,13 @@ private function parseDefaultExpression(?string $default): ?string /** * {@inheritdoc} */ - public function listTableDetails($tableName): Table + public function listTableDetails($name): Table { - $table = parent::listTableDetails($tableName); + $table = parent::listTableDetails($name); $platform = $this->_platform; assert($platform instanceof PostgreSqlPlatform); - $sql = $platform->getListTableMetadataSQL($tableName); + $sql = $platform->getListTableMetadataSQL($name); $tableOptions = $this->_conn->fetchAssoc($sql); diff --git a/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php b/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php index dd34010869c..05eb1d11c46 100644 --- a/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SQLServerSchemaManager.php @@ -331,15 +331,15 @@ private function closeActiveDatabaseConnections($database) } /** - * @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; assert($platform instanceof SQLServerPlatform); - $sql = $platform->getListTableMetadataSQL($tableName); + $sql = $platform->getListTableMetadataSQL($name); $tableOptions = $this->_conn->fetchAssoc($sql); diff --git a/lib/Doctrine/DBAL/Schema/Schema.php b/lib/Doctrine/DBAL/Schema/Schema.php index 80a826ab050..6ea5fd0c8c0 100644 --- a/lib/Doctrine/DBAL/Schema/Schema.php +++ b/lib/Doctrine/DBAL/Schema/Schema.php @@ -165,20 +165,20 @@ public function getTables() } /** - * @param string $tableName + * @param string $name * * @return Table * * @throws SchemaException */ - public function getTable($tableName) + public function getTable($name) { - $tableName = $this->getFullQualifiedAssetName($tableName); - if (! isset($this->_tables[$tableName])) { - throw SchemaException::tableDoesNotExist($tableName); + $name = $this->getFullQualifiedAssetName($name); + if (! isset($this->_tables[$name])) { + throw SchemaException::tableDoesNotExist($name); } - return $this->_tables[$tableName]; + return $this->_tables[$name]; } /** @@ -216,29 +216,29 @@ private function getUnquotedAssetName($assetName) /** * Does this schema have a namespace with the given name? * - * @param string $namespaceName + * @param string $name * * @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? * - * @param string $tableName + * @param string $name * * @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 @@ public function getSequences() /** * 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. * * @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])) { - throw SchemaException::namespaceAlreadyExists($unquotedNamespaceName); + if (isset($this->namespaces[$unquotedName])) { + throw SchemaException::namespaceAlreadyExists($unquotedName); } - $this->namespaces[$unquotedNamespaceName] = $namespaceName; + $this->namespaces[$unquotedName] = $name; return $this; } @@ -313,17 +313,17 @@ public function createNamespace($namespaceName) /** * Creates a new table. * - * @param string $tableName + * @param string $name * * @return Table */ - public function createTable($tableName) + public function createTable($name) { - $table = new Table($tableName); + $table = new Table($name); $this->_addTable($table); - foreach ($this->_schemaConfig->getDefaultTableOptions() as $name => $value) { - $table->addOption($name, $value); + foreach ($this->_schemaConfig->getDefaultTableOptions() as $option => $value) { + $table->addOption($option, $value); } return $table; @@ -332,17 +332,17 @@ public function createTable($tableName) /** * Renames a table. * - * @param string $oldTableName - * @param string $newTableName + * @param string $oldName + * @param string $newName * * @return Schema */ - public function renameTable($oldTableName, $newTableName) + public function renameTable($oldName, $newName) { - $table = $this->getTable($oldTableName); - $table->_setName($newTableName); + $table = $this->getTable($oldName); + $table->_setName($newName); - $this->dropTable($oldTableName); + $this->dropTable($oldName); $this->_addTable($table); return $this; @@ -351,15 +351,15 @@ public function renameTable($oldTableName, $newTableName) /** * Drops a table from the schema. * - * @param string $tableName + * @param string $name * * @return Schema */ - public function dropTable($tableName) + public function dropTable($name) { - $tableName = $this->getFullQualifiedAssetName($tableName); - $this->getTable($tableName); - unset($this->_tables[$tableName]); + $name = $this->getFullQualifiedAssetName($name); + $this->getTable($name); + unset($this->_tables[$name]); return $this; } diff --git a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php index 3d149e895ed..9a95f628e34 100644 --- a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php @@ -537,15 +537,15 @@ private function getCreateTableSQL(string $table): ?string } /** - * @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) { $table->addOption('comment', $comment); diff --git a/lib/Doctrine/DBAL/Schema/Table.php b/lib/Doctrine/DBAL/Schema/Table.php index a6be32c68a4..744b3715e18 100644 --- a/lib/Doctrine/DBAL/Schema/Table.php +++ b/lib/Doctrine/DBAL/Schema/Table.php @@ -44,7 +44,7 @@ class Table extends AbstractAsset protected $_schemaConfig = null; /** - * @param string $tableName + * @param string $name * @param Column[] $columns * @param Index[] $indexes * @param ForeignKeyConstraint[] $fkConstraints @@ -53,13 +53,13 @@ class Table extends AbstractAsset * * @throws DBALException */ - public function __construct($tableName, array $columns = [], array $indexes = [], array $fkConstraints = [], $idGeneratorType = 0, array $options = []) + public function __construct($name, array $columns = [], array $indexes = [], array $fkConstraints = [], $idGeneratorType = 0, array $options = []) { - if (strlen($tableName) === 0) { - throw DBALException::invalidTableName($tableName); + if (strlen($name) === 0) { + throw DBALException::invalidTableName($name); } - $this->_setName($tableName); + $this->_setName($name); foreach ($columns as $column) { $this->_addColumn($column); @@ -151,20 +151,20 @@ public function dropPrimaryKey() /** * Drops an index from this table. * - * @param string $indexName The index name. + * @param string $name The index name. * * @return void * * @throws SchemaException If the index does not exist. */ - public function dropIndex($indexName) + public function dropIndex($name) { - $indexName = $this->normalizeIdentifier($indexName); - if (! $this->hasIndex($indexName)) { - throw SchemaException::indexDoesNotExist($indexName, $this->_name); + $name = $this->normalizeIdentifier($name); + if (! $this->hasIndex($name)) { + throw SchemaException::indexDoesNotExist($name, $this->_name); } - unset($this->_indexes[$indexName]); + unset($this->_indexes[$name]); } /** @@ -190,8 +190,8 @@ public function addUniqueIndex(array $columnNames, $indexName = null, array $opt /** * Renames an index. * - * @param string $oldIndexName The name of the index to rename from. - * @param string|null $newIndexName The name of the index to rename to. + * @param string $oldName The name of the index to rename from. + * @param string|null $newName The name of the index to rename to. * If null is given, the index name will be auto-generated. * * @return self This table instance. @@ -199,38 +199,38 @@ public function addUniqueIndex(array $columnNames, $indexName = null, array $opt * @throws SchemaException If no index exists for the given current name * or if an index with the given new name already exists on this table. */ - public function renameIndex($oldIndexName, $newIndexName = null) + public function renameIndex($oldName, $newName = null) { - $oldIndexName = $this->normalizeIdentifier($oldIndexName); - $normalizedNewIndexName = $this->normalizeIdentifier($newIndexName); + $oldName = $this->normalizeIdentifier($oldName); + $normalizedNewName = $this->normalizeIdentifier($newName); - if ($oldIndexName === $normalizedNewIndexName) { + if ($oldName === $normalizedNewName) { return $this; } - if (! $this->hasIndex($oldIndexName)) { - throw SchemaException::indexDoesNotExist($oldIndexName, $this->_name); + if (! $this->hasIndex($oldName)) { + throw SchemaException::indexDoesNotExist($oldName, $this->_name); } - if ($this->hasIndex($normalizedNewIndexName)) { - throw SchemaException::indexAlreadyExists($normalizedNewIndexName, $this->_name); + if ($this->hasIndex($normalizedNewName)) { + throw SchemaException::indexAlreadyExists($normalizedNewName, $this->_name); } - $oldIndex = $this->_indexes[$oldIndexName]; + $oldIndex = $this->_indexes[$oldName]; if ($oldIndex->isPrimary()) { $this->dropPrimaryKey(); - return $this->setPrimaryKey($oldIndex->getColumns(), $newIndexName ?? false); + return $this->setPrimaryKey($oldIndex->getColumns(), $newName ?? false); } - unset($this->_indexes[$oldIndexName]); + unset($this->_indexes[$oldName]); if ($oldIndex->isUnique()) { - return $this->addUniqueIndex($oldIndex->getColumns(), $newIndexName, $oldIndex->getOptions()); + return $this->addUniqueIndex($oldIndex->getColumns(), $newName, $oldIndex->getOptions()); } - return $this->addIndex($oldIndex->getColumns(), $newIndexName, $oldIndex->getFlags(), $oldIndex->getOptions()); + return $this->addIndex($oldIndex->getColumns(), $newName, $oldIndex->getFlags(), $oldIndex->getOptions()); } /** @@ -279,15 +279,15 @@ private function _createIndex(array $columnNames, $indexName, $isUnique, $isPrim } /** - * @param string $columnName + * @param string $name * @param string $typeName * @param mixed[] $options * * @return Column */ - public function addColumn($columnName, $typeName, array $options = []) + public function addColumn($name, $typeName, array $options = []) { - $column = new Column($columnName, Type::getType($typeName), $options); + $column = new Column($name, Type::getType($typeName), $options); $this->_addColumn($column); @@ -299,14 +299,14 @@ public function addColumn($columnName, $typeName, array $options = []) * * @deprecated * - * @param string $oldColumnName - * @param string $newColumnName + * @param string $oldName + * @param string $name * * @return void * * @throws DBALException */ - public function renameColumn($oldColumnName, $newColumnName) + public function renameColumn($oldName, $name) { throw new DBALException('Table#renameColumn() was removed, because it drops and recreates ' . 'the column instead. There is no fix available, because a schema diff cannot reliably detect if a ' . @@ -316,14 +316,14 @@ public function renameColumn($oldColumnName, $newColumnName) /** * Change Column Details. * - * @param string $columnName + * @param string $name * @param mixed[] $options * * @return self */ - public function changeColumn($columnName, array $options) + public function changeColumn($name, array $options) { - $column = $this->getColumn($columnName); + $column = $this->getColumn($name); $column->setOptions($options); return $this; @@ -332,14 +332,14 @@ public function changeColumn($columnName, array $options) /** * Drops a Column from the Table. * - * @param string $columnName + * @param string $name * * @return self */ - public function dropColumn($columnName) + public function dropColumn($name) { - $columnName = $this->normalizeIdentifier($columnName); - unset($this->_columns[$columnName]); + $name = $this->normalizeIdentifier($name); + unset($this->_columns[$name]); return $this; } @@ -541,53 +541,53 @@ protected function _addForeignKeyConstraint(ForeignKeyConstraint $constraint) /** * Returns whether this table has a foreign key constraint with the given name. * - * @param string $constraintName + * @param string $name * * @return bool */ - public function hasForeignKey($constraintName) + public function hasForeignKey($name) { - $constraintName = $this->normalizeIdentifier($constraintName); + $name = $this->normalizeIdentifier($name); - return isset($this->_fkConstraints[$constraintName]); + return isset($this->_fkConstraints[$name]); } /** * Returns the foreign key constraint with the given name. * - * @param string $constraintName The constraint name. + * @param string $name The constraint name. * * @return ForeignKeyConstraint * * @throws SchemaException If the foreign key does not exist. */ - public function getForeignKey($constraintName) + public function getForeignKey($name) { - $constraintName = $this->normalizeIdentifier($constraintName); - if (! $this->hasForeignKey($constraintName)) { - throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name); + $name = $this->normalizeIdentifier($name); + if (! $this->hasForeignKey($name)) { + throw SchemaException::foreignKeyDoesNotExist($name, $this->_name); } - return $this->_fkConstraints[$constraintName]; + return $this->_fkConstraints[$name]; } /** * Removes the foreign key constraint with the given name. * - * @param string $constraintName The constraint name. + * @param string $name The constraint name. * * @return void * * @throws SchemaException */ - public function removeForeignKey($constraintName) + public function removeForeignKey($name) { - $constraintName = $this->normalizeIdentifier($constraintName); - if (! $this->hasForeignKey($constraintName)) { - throw SchemaException::foreignKeyDoesNotExist($constraintName, $this->_name); + $name = $this->normalizeIdentifier($name); + if (! $this->hasForeignKey($name)) { + throw SchemaException::foreignKeyDoesNotExist($name, $this->_name); } - unset($this->_fkConstraints[$constraintName]); + unset($this->_fkConstraints[$name]); } /** @@ -639,34 +639,34 @@ private function filterColumns(array $columnNames) /** * Returns whether this table has a Column with the given name. * - * @param string $columnName The column name. + * @param string $name The column name. * * @return bool */ - public function hasColumn($columnName) + public function hasColumn($name) { - $columnName = $this->normalizeIdentifier($columnName); + $name = $this->normalizeIdentifier($name); - return isset($this->_columns[$columnName]); + return isset($this->_columns[$name]); } /** * Returns the Column with the given name. * - * @param string $columnName The column name. + * @param string $name The column name. * * @return Column * * @throws SchemaException If the column does not exist. */ - public function getColumn($columnName) + public function getColumn($name) { - $columnName = $this->normalizeIdentifier($columnName); - if (! $this->hasColumn($columnName)) { - throw SchemaException::columnDoesNotExist($columnName, $this->_name); + $name = $this->normalizeIdentifier($name); + if (! $this->hasColumn($name)) { + throw SchemaException::columnDoesNotExist($name, $this->_name); } - return $this->_columns[$columnName]; + return $this->_columns[$name]; } /** @@ -714,34 +714,34 @@ public function hasPrimaryKey() /** * Returns whether this table has an Index with the given name. * - * @param string $indexName The index name. + * @param string $name The index name. * * @return bool */ - public function hasIndex($indexName) + public function hasIndex($name) { - $indexName = $this->normalizeIdentifier($indexName); + $name = $this->normalizeIdentifier($name); - return isset($this->_indexes[$indexName]); + return isset($this->_indexes[$name]); } /** * Returns the Index with the given name. * - * @param string $indexName The index name. + * @param string $name The index name. * * @return Index * * @throws SchemaException If the index does not exist. */ - public function getIndex($indexName) + public function getIndex($name) { - $indexName = $this->normalizeIdentifier($indexName); - if (! $this->hasIndex($indexName)) { - throw SchemaException::indexDoesNotExist($indexName, $this->_name); + $name = $this->normalizeIdentifier($name); + if (! $this->hasIndex($name)) { + throw SchemaException::indexDoesNotExist($name, $this->_name); } - return $this->_indexes[$indexName]; + return $this->_indexes[$name]; } /**