Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Be more consistent with string quoting.

  • Loading branch information...
commit f276c65bb44c6d1e2b0c89269ce0c7e0b00e2a22 1 parent 1aa8278
@posulliv authored
Showing with 31 additions and 31 deletions.
  1. +31 −31 lib/Doctrine/DBAL/Platforms/AkibanServerPlatform.php
View
62 lib/Doctrine/DBAL/Platforms/AkibanServerPlatform.php
@@ -44,9 +44,9 @@ class AkibanServerPlatform extends AbstractPlatform
public function getSubstringExpression($value, $from, $len = null)
{
if ($len === null) {
- return 'SUBSTR(' . $value . ', ' . $from . ')';
+ return "SUBSTR(" . $value . ", " . $from . ")";
} else {
- return 'SUBSTR(' . $value . ', ' . $from . ', ' . $len . ')';
+ return "SUBSTR(" . $value . ", " . $from . ", " . $len . ")";
}
}
@@ -62,35 +62,35 @@ public function getLocateExpression($str, $substr, $startPos = false)
{
if ($startPos !== false) {
$str = $this->getSubstringExpression($str, $startPos);
- return 'CASE WHEN (POSITION('.$substr.' IN '.$str.') = 0) THEN 0 ELSE (POSITION('.$substr.' IN '.$str.') + '.($startPos-1).') END';
+ return "CASE WHEN (POSITION(" . $substr . " IN " . $str . ") = 0) THEN 0 ELSE (POSITION(" . $substr . " IN " . $str . ") + " . ($startPos-1) . ") END";
} else {
- return 'POSITION('.$substr.' IN '.$str.')';
+ return "POSITION(" . $substr . " IN " . $str . ")";
}
}
public function getDateDiffExpression($date1, $date2)
{
- return 'DATEDIFF(' . $date1 . ', ' . $date2 . ')';
+ return "DATEDIFF(" . $date1 . ", " . $date2 . ")";
}
public function getDateAddDaysExpression($date, $days)
{
- return 'DATE_ADD(' . $date . ', INTERVAL ' . $days . ' DAY)';
+ return "DATE_ADD(" . $date . ", INTERVAL " . $days . " DAY)";
}
public function getDateSubDaysExpression($date, $days)
{
- return 'DATE_SUB(' . $date . ', INTERVAL ' . $days . ' DAY)';
+ return "DATE_SUB(" . $date . ", INTERVAL " . $days . " DAY)";
}
public function getDateAddMonthExpression($date, $months)
{
- return 'DATE_ADD(' . $date . ', INTERVAL ' . $months . ' MONTH)';
+ return "DATE_ADD(" . $date . ", INTERVAL " . $months . " MONTH)";
}
public function getDateSubMonthExpression($date, $months)
{
- return 'DATE_SUB(' . $date . ', INTERVAL ' . $months . ' MONTH)';
+ return "DATE_SUB(" . $date . ", INTERVAL " . $months . " MONTH)";
}
/**
@@ -241,7 +241,7 @@ public function getListTableIndexesSQL($table, $currentDatabase = null)
public function getListTableColumnsSQL($table, $database = null)
{
- if ( ! is_null($database)) {
+ if (! is_null($database)) {
$schemaPredicate = "schema_name = '" . $database . "' and ";
} else {
$schemePredicate = "";
@@ -261,7 +261,7 @@ public function getListTableColumnsSQL($table, $database = null)
*/
public function getCreateDatabaseSQL($name)
{
- return 'CREATE SCHEMA ' . $name;
+ return "CREATE SCHEMA " . $name;
}
/**
@@ -381,7 +381,7 @@ public function getDropSequenceSQL($sequence)
if ($sequence instanceof \Doctrine\DBAL\Schema\Sequence) {
$sequence = $sequence->getQuotedName($this);
}
- return 'DROP SEQUENCE ' . $sequence . ' RESTRICT';
+ return "DROP SEQUENCE " . $sequence . " RESTRICT";
}
/**
@@ -448,7 +448,7 @@ public function getSequenceNextValSQL($sequenceName)
*/
public function getBooleanTypeDeclarationSQL(array $field)
{
- return 'BOOLEAN';
+ return "BOOLEAN";
}
/**
@@ -456,10 +456,10 @@ public function getBooleanTypeDeclarationSQL(array $field)
*/
public function getIntegerTypeDeclarationSQL(array $field)
{
- if ( ! empty($field['autoincrement'])) {
- return 'SERIAL';
+ if (! empty($field['autoincrement'])) {
+ return "SERIAL";
}
- return 'INT';
+ return "INT";
}
/**
@@ -467,10 +467,10 @@ public function getIntegerTypeDeclarationSQL(array $field)
*/
public function getBigIntTypeDeclarationSQL(array $field)
{
- if ( ! empty($field['autoincrement'])) {
- return 'BIGSERIAL';
+ if (! empty($field['autoincrement'])) {
+ return "BIGSERIAL";
}
- return 'BIGINT';
+ return "BIGINT";
}
/**
@@ -478,7 +478,7 @@ public function getBigIntTypeDeclarationSQL(array $field)
*/
public function getSmallIntTypeDeclarationSQL(array $field)
{
- return 'SMALLINT';
+ return "SMALLINT";
}
/**
@@ -487,9 +487,9 @@ public function getSmallIntTypeDeclarationSQL(array $field)
public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration)
{
if (isset($fieldDeclaration['version']) && $fieldDeclaration['version'] == true) {
- return 'TIMESTAMP';
+ return "TIMESTAMP";
} else {
- return 'DATETIME';
+ return "DATETIME";
}
}
@@ -498,7 +498,7 @@ public function getDateTimeTypeDeclarationSQL(array $fieldDeclaration)
*/
public function getDateTypeDeclarationSQL(array $fieldDeclaration)
{
- return 'DATE';
+ return "DATE";
}
/**
@@ -506,7 +506,7 @@ public function getDateTypeDeclarationSQL(array $fieldDeclaration)
*/
public function getTimeTypeDeclarationSQL(array $fieldDeclaration)
{
- return 'TIME';
+ return "TIME";
}
/**
@@ -514,7 +514,7 @@ public function getTimeTypeDeclarationSQL(array $fieldDeclaration)
*/
protected function _getCommonIntegerTypeDeclarationSQL(array $columnDef)
{
- return '';
+ return "";
}
/**
@@ -532,7 +532,7 @@ protected function getVarcharTypeDeclarationSQLSnippet($length, $fixed)
/** @override */
public function getClobTypeDeclarationSQL(array $field)
{
- return 'BLOB';
+ return "BLOB";
}
/**
@@ -542,7 +542,7 @@ public function getClobTypeDeclarationSQL(array $field)
*/
public function getName()
{
- return 'akibansrv';
+ return "akibansrv";
}
/**
@@ -567,7 +567,7 @@ public function getSQLResultCasing($column)
*/
public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierColumnName)
{
- return 'INSERT INTO ' . $quotedTableName . ' (' . $quotedIdentifierColumnName . ') VALUES (DEFAULT)';
+ return "INSERT INTO " . $quotedTableName . " (" . $quotedIdentifierColumnName . ") VALUES (DEFAULT)";
}
/**
@@ -575,7 +575,7 @@ public function getEmptyIdentityInsertSQL($quotedTableName, $quotedIdentifierCol
*/
public function getTruncateTableSQL($tableName, $cascade = false)
{
- return 'TRUNCATE TABLE ' . $tableName . ' ' . (($cascade) ? 'CASCADE' : '');
+ return "TRUNCATE TABLE " . $tableName . " " . (($cascade) ? "CASCADE" : "");
}
protected function initializeDoctrineTypeMappings()
@@ -611,7 +611,7 @@ public function getVarcharMaxLength()
protected function getReservedKeywordsClass()
{
- return 'Doctrine\DBAL\Platforms\Keywords\AkibanSrvKeywords';
+ return "Doctrine\DBAL\Platforms\Keywords\AkibanSrvKeywords";
}
/**
@@ -619,6 +619,6 @@ protected function getReservedKeywordsClass()
*/
public function getBlobTypeDeclarationSQL(array $field)
{
- return 'BLOB';
+ return "BLOB";
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.