From 91f1b30a7f6c455d59083d85e4fceed6a8f22df5 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Sun, 26 Apr 2015 01:16:25 +0200 Subject: [PATCH] Documentation & code styling fixes --- lib/Doctrine/DBAL/Connection.php | 4 ++-- lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php | 2 +- lib/Doctrine/DBAL/DriverManager.php | 5 +++-- lib/Doctrine/DBAL/Id/TableGenerator.php | 2 +- lib/Doctrine/DBAL/Platforms/DB2Platform.php | 1 - lib/Doctrine/DBAL/Platforms/MySqlPlatform.php | 9 +++++++++ lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php | 2 +- lib/Doctrine/DBAL/Query/QueryBuilder.php | 2 ++ lib/Doctrine/DBAL/Schema/Schema.php | 2 ++ lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php | 6 ++++++ 10 files changed, 27 insertions(+), 8 deletions(-) diff --git a/lib/Doctrine/DBAL/Connection.php b/lib/Doctrine/DBAL/Connection.php index 0d6a21980cb..be66086aaf3 100644 --- a/lib/Doctrine/DBAL/Connection.php +++ b/lib/Doctrine/DBAL/Connection.php @@ -1104,7 +1104,7 @@ public function transactional(Closure $func) $func($this); $this->commit(); } catch (Exception $e) { - $this->rollback(); + $this->rollBack(); throw $e; } } @@ -1268,7 +1268,7 @@ public function rollBack() $logger->startQuery('"ROLLBACK"'); } $this->_transactionNestingLevel = 0; - $this->_conn->rollback(); + $this->_conn->rollBack(); $this->_isRollbackOnly = false; if ($logger) { $logger->stopQuery(); diff --git a/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php b/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php index 4c04bfb3e72..84bcb6f5e81 100644 --- a/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php +++ b/lib/Doctrine/DBAL/Driver/PDOSqlsrv/Connection.php @@ -29,7 +29,7 @@ class Connection extends PDOConnection implements \Doctrine\DBAL\Driver\Connection { /** - * @override + * {@inheritDoc} */ public function quote($value, $type=\PDO::PARAM_STR) { diff --git a/lib/Doctrine/DBAL/DriverManager.php b/lib/Doctrine/DBAL/DriverManager.php index 75004a40718..d9a6a0c4cc5 100644 --- a/lib/Doctrine/DBAL/DriverManager.php +++ b/lib/Doctrine/DBAL/DriverManager.php @@ -218,9 +218,10 @@ private static function _checkParams(array $params) * * @param array $params The list of parameters. * - * @param array A modified list of parameters with info from a database - * URL extracted into indidivual parameter parts. + * @return array A modified list of parameters with info from a database + * URL extracted into indidivual parameter parts. * + * @throws DBALException */ private static function parseDatabaseUrl(array $params) { diff --git a/lib/Doctrine/DBAL/Id/TableGenerator.php b/lib/Doctrine/DBAL/Id/TableGenerator.php index 62d6fcb8ef1..fe66b07748e 100644 --- a/lib/Doctrine/DBAL/Id/TableGenerator.php +++ b/lib/Doctrine/DBAL/Id/TableGenerator.php @@ -156,7 +156,7 @@ public function nextValue($sequenceName) $this->conn->commit(); } catch (\Exception $e) { - $this->conn->rollback(); + $this->conn->rollBack(); throw new \Doctrine\DBAL\DBALException("Error occurred while generating ID with TableGenerator, aborted generation: " . $e->getMessage(), 0, $e); } diff --git a/lib/Doctrine/DBAL/Platforms/DB2Platform.php b/lib/Doctrine/DBAL/Platforms/DB2Platform.php index 9cc794d16a1..b6ef11c1951 100644 --- a/lib/Doctrine/DBAL/Platforms/DB2Platform.php +++ b/lib/Doctrine/DBAL/Platforms/DB2Platform.php @@ -20,7 +20,6 @@ namespace Doctrine\DBAL\Platforms; use Doctrine\DBAL\DBALException; -use Doctrine\DBAL\Schema\Column; use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\Identifier; use Doctrine\DBAL\Schema\Index; diff --git a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index 9824ca883ee..ae75979c30c 100644 --- a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -49,6 +49,12 @@ class MySqlPlatform extends AbstractPlatform /** * Adds MySQL-specific LIMIT clause to the query * 18446744073709551615 is 2^64-1 maximum of unsigned BIGINT the biggest limit possible + * + * @param string $query + * @param integer $limit + * @param integer $offset + * + * @return string */ protected function doModifyLimitQuery($query, $limit, $offset) { @@ -346,6 +352,9 @@ public function supportsColumnCollation() return true; } + /** + * {@inheritDoc} + */ public function getListTablesSQL() { return "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'"; diff --git a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php index cb512c47939..8b3b284c932 100644 --- a/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php @@ -517,7 +517,7 @@ public function getAlterTableSQL(TableDiff $diff) } if ($columnDiff->hasChanged('notnull')) { - $query = 'ALTER ' . $oldColumnName . ' ' . ($column->getNotNull() ? 'SET' : 'DROP') . ' NOT NULL'; + $query = 'ALTER ' . $oldColumnName . ' ' . ($column->getNotnull() ? 'SET' : 'DROP') . ' NOT NULL'; $sql[] = 'ALTER TABLE ' . $diff->getName($this)->getQuotedName($this) . ' ' . $query; } diff --git a/lib/Doctrine/DBAL/Query/QueryBuilder.php b/lib/Doctrine/DBAL/Query/QueryBuilder.php index 0a6d59e3745..a16496cebb5 100644 --- a/lib/Doctrine/DBAL/Query/QueryBuilder.php +++ b/lib/Doctrine/DBAL/Query/QueryBuilder.php @@ -1302,6 +1302,8 @@ public function createPositionalParameter($value, $type = \PDO::PARAM_STR) * @param array $knownAliases * * @return string + * + * @throws QueryException */ private function getSQLForJoins($fromAlias, array &$knownAliases) { diff --git a/lib/Doctrine/DBAL/Schema/Schema.php b/lib/Doctrine/DBAL/Schema/Schema.php index b7e24fe9193..3277ad72cf1 100644 --- a/lib/Doctrine/DBAL/Schema/Schema.php +++ b/lib/Doctrine/DBAL/Schema/Schema.php @@ -313,6 +313,8 @@ public function getSequences() * @param string $namespaceName The name of the namespace to create. * * @return \Doctrine\DBAL\Schema\Schema This schema instance. + * + * @throws SchemaException */ public function createNamespace($namespaceName) { diff --git a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php index 08c90cf984d..3e82f38a7f1 100644 --- a/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/SqliteSchemaManager.php @@ -418,6 +418,12 @@ private function getTableDiffForAlterForeignKey(ForeignKeyConstraint $foreignKey return $tableDiff; } + /** + * @param string $column + * @param string $sql + * + * @return string|false + */ private function parseColumnCollationFromSQL($column, $sql) { if (preg_match(